Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

Add UnWrapper interface and implement in LimitedFs

Nick Craig-Woodbed01a303f72
diff --git a/fs/fs.go b/fs/fs.go
index a8c55775b..5188870e3 100644
--- a/fs/fs.go
+++ b/fs/fs.go
@@ -198,6 +198,12 @@ type DirMover interface {
DirMove(src Fs) error
}
+// UnWrapper is an optional interfaces for Fs
+type UnWrapper interface {
+ // UnWrap returns the Fs that this Fs is wrapping
+ UnWrap() Fs
+}
+
// ObjectsChan is a channel of Objects
type ObjectsChan chan Object
diff --git a/fs/limited.go b/fs/limited.go
index ad30c0b00..c37d4954d 100644
--- a/fs/limited.go
+++ b/fs/limited.go
@@ -130,9 +130,15 @@ func (f *Limited) Move(src Object, remote string) (Object, error) {
return fMove.Move(src, remote)
}
+// UnWrap returns the Fs that this Fs is wrapping
+func (f *Limited) UnWrap() Fs {
+ return f.fs
+}
+
// Check the interfaces are satisfied
var (
- _ Fs = (*Limited)(nil)
- _ Copier = (*Limited)(nil)
- _ Mover = (*Limited)(nil)
+ _ Fs = (*Limited)(nil)
+ _ Copier = (*Limited)(nil)
+ _ Mover = (*Limited)(nil)
+ _ UnWrapper = (*Limited)(nil)
)