"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
Update docs
Nick Craig-Woodb41367856bfc
diff --git a/fs.go b/fs.goindex 688b2f65e..bfca0d3fd 100644--- a/fs.go+++ b/fs.go@@ -11,11 +11,26 @@ import (// A Filesystem, describes the local filesystem and the remote object storetype Fs interface {+ // String returns a description of the FSString() string++ // List the Fs into a channelList() FsObjectsChan++ // Find the FsObject at remote. Returns nil if can't be foundNewFsObject(remote string) FsObject++ // Put in to the remote path with the modTime given of the given size+ //+ // May create the object even if it returns an error - if so+ // will return the object and the error, otherwise will return+ // nil and the errorPut(in io.Reader, remote string, modTime time.Time, size int64) (FsObject, error)++ // Make the directory (container, bucket)Mkdir() error++ // Remove the directory (container, bucket) if emptyRmdir() error}@@ -24,13 +39,28 @@ type Fs interface {// A filesystem like object which can either be a remote object or a// local file/directorytype FsObject interface {+ // Remote returns the remote pathRemote() string++ // Md5sum returns the md5 checksum of the fileMd5sum() (string, error)++ // ModTime returns the modification date of the fileModTime() time.Time++ // SetModTime sets the metadata on the object to set the modification dateSetModTime(time.Time)++ // Size returns the size of the fileSize() int64++ // Open opens the file for read. Call Close() on the returned io.ReadCloserOpen() (io.ReadCloser, error)++ // Storable says whether this object can be storedStorable() bool++ // Removes this objectRemove() error}@@ -43,13 +73,15 @@ type Purger interface {Purge() error}+// A channel of FsObjectstype FsObjectsChan chan FsObject+// A slice of FsObjectstype FsObjects []FsObject// NewFs makes a new Fs object from the path//-// FIXME make more generic in future+// FIXME make more genericfunc NewFs(path string) (Fs, error) {if swiftMatch.MatchString(path) {return NewFsSwift(path)@@ -176,12 +208,14 @@ func Copy(f Fs, src FsObject) {}if err != nil {stats.Error()- FsLog(dst, "Failed to copy: %s", err)- FsDebug(dst, "Removing failed copy")- removeErr := dst.Remove()- if removeErr != nil {- stats.Error()- FsLog(dst, "Failed to remove failed copy: %s", removeErr)+ FsLog(src, "Failed to copy: %s", err)+ if dst != nil {+ FsDebug(dst, "Removing failed copy")+ removeErr := dst.Remove()+ if removeErr != nil {+ stats.Error()+ FsLog(dst, "Failed to remove failed copy: %s", removeErr)+ }}return}