Add UnWrapper interface and implement in LimitedFs

This commit is contained in:
Nick Craig-Wood 2015-11-08 15:27:55 +00:00
parent 2c2cb84ca7
commit bed01a303f
2 changed files with 15 additions and 3 deletions

View file

@ -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

View file

@ -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)
)