"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
fs: introduces aliases for OpenWriterAtFn and OpenChunkWriterFn
Nick Craig-Woodb4e3332e024e
diff --git a/fs/features.go b/fs/features.goindex d722b4412..019dcfcdc 100644--- a/fs/features.go+++ b/fs/features.go@@ -636,6 +636,9 @@ type OpenWriterAter interface {OpenWriterAt(ctx context.Context, remote string, size int64) (WriterAtCloser, error)}+// OpenWriterAtFn describes the OpenWriterAt function pointer+type OpenWriterAtFn func(ctx context.Context, remote string, size int64) (WriterAtCloser, error)+type OpenChunkWriter interface {// OpenChunkWriter returns the chunk size and a ChunkWriter//@@ -644,6 +647,9 @@ type OpenChunkWriter interface {OpenChunkWriter(ctx context.Context, remote string, src ObjectInfo, options ...OpenOption) (chunkSize int64, writer ChunkWriter, err error)}+// OpenChunkWriterFn describes the OpenChunkWriter function pointer+type OpenChunkWriterFn func(ctx context.Context, remote string, src ObjectInfo, options ...OpenOption) (chunkSize int64, writer ChunkWriter, err error)+type ChunkWriter interface {// WriteChunk will write chunk number with reader bytes, where chunk number >= 0WriteChunk(chunkNumber int, reader io.ReadSeeker) (bytesWritten int64, err error)diff --git a/fs/operations/multithread.go b/fs/operations/multithread.goindex deb7c88ba..f675588bc 100644--- a/fs/operations/multithread.go+++ b/fs/operations/multithread.go@@ -277,7 +277,8 @@ func (w writerAtChunkWriter) Abort() error {return obj.Remove(w.ctx)}-func openChunkWriterFromOpenWriterAt(openWriterAt func(ctx context.Context, remote string, size int64) (fs.WriterAtCloser, error), chunkSize int64, writeBufferSize int64, f fs.Fs) func(ctx context.Context, remote string, src fs.ObjectInfo, options ...fs.OpenOption) (chunkSizeResult int64, writer fs.ChunkWriter, err error) {+// openChunkWriterFromOpenWriterAt adapts an OpenWriterAtFn into an OpenChunkWriterFn using chunkSize and writeBufferSize+func openChunkWriterFromOpenWriterAt(openWriterAt fs.OpenWriterAtFn, chunkSize int64, writeBufferSize int64, f fs.Fs) fs.OpenChunkWriterFn {return func(ctx context.Context, remote string, src fs.ObjectInfo, options ...fs.OpenOption) (chunkSizeResult int64, writer fs.ChunkWriter, err error) {writerAt, err := openWriterAt(ctx, remote, src.Size())if err != nil {