forked from TrueCloudLab/rclone
Add UnWrapper interface and implement in LimitedFs
This commit is contained in:
parent
2c2cb84ca7
commit
bed01a303f
2 changed files with 15 additions and 3 deletions
6
fs/fs.go
6
fs/fs.go
|
@ -198,6 +198,12 @@ type DirMover interface {
|
||||||
DirMove(src Fs) error
|
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
|
// ObjectsChan is a channel of Objects
|
||||||
type ObjectsChan chan Object
|
type ObjectsChan chan Object
|
||||||
|
|
||||||
|
|
|
@ -130,9 +130,15 @@ func (f *Limited) Move(src Object, remote string) (Object, error) {
|
||||||
return fMove.Move(src, remote)
|
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
|
// Check the interfaces are satisfied
|
||||||
var (
|
var (
|
||||||
_ Fs = (*Limited)(nil)
|
_ Fs = (*Limited)(nil)
|
||||||
_ Copier = (*Limited)(nil)
|
_ Copier = (*Limited)(nil)
|
||||||
_ Mover = (*Limited)(nil)
|
_ Mover = (*Limited)(nil)
|
||||||
|
_ UnWrapper = (*Limited)(nil)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue