mirror of
https://github.com/rclone/rclone.git
synced 2025-08-16 08:38:11 +02:00
Implement server side copies if possible - fixes #99
Add optional fs.Copier interface Implemented for * swift * s3 * drive * dropbox * google cloud storage
This commit is contained in:
14
fs/fs.go
14
fs/fs.go
@ -24,6 +24,7 @@ var (
|
||||
fsRegistry []*FsInfo
|
||||
// Error returned by NewFs if not found in config file
|
||||
NotFoundInConfigFile = fmt.Errorf("Didn't find section in config file")
|
||||
ErrorCantCopy = fmt.Errorf("Can't copy object - incompatible remotes")
|
||||
)
|
||||
|
||||
// Filesystem info
|
||||
@ -149,6 +150,19 @@ type Purger interface {
|
||||
Purge() error
|
||||
}
|
||||
|
||||
type Copier interface {
|
||||
// Copy src to this remote using server side copy operations.
|
||||
//
|
||||
// This is stored with the remote path given
|
||||
//
|
||||
// It returns the destination Object and a possible error
|
||||
//
|
||||
// Will only be called if src.Fs().Name() == f.Name()
|
||||
//
|
||||
// If it isn't possible then return fs.ErrorCantCopy
|
||||
Copy(src Object, remote string) (Object, error)
|
||||
}
|
||||
|
||||
// An optional interface for error as to whether the operation should be retried
|
||||
//
|
||||
// This should be returned from Update or Put methods as required
|
||||
|
Reference in New Issue
Block a user