forked from TrueCloudLab/rclone
Implement Move in limited fs
This commit is contained in:
parent
80ffbade22
commit
e9dda25c60
1 changed files with 22 additions and 2 deletions
|
@ -113,6 +113,26 @@ func (f *Limited) Copy(src Object, remote string) (Object, error) {
|
||||||
return fCopy.Copy(src, remote)
|
return fCopy.Copy(src, remote)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Move src to this remote using server side move operations.
|
||||||
|
//
|
||||||
|
// This is stored with the remote path given
|
||||||
|
//
|
||||||
|
// It returns the destination Object and a possible error
|
||||||
|
//
|
||||||
|
// Will only be called if src.Fs().Name() == f.Name()
|
||||||
|
//
|
||||||
|
// If it isn't possible then return fs.ErrorCantMove
|
||||||
|
func (f *Limited) Move(src Object, remote string) (Object, error) {
|
||||||
|
fMove, ok := f.fs.(Mover)
|
||||||
|
if !ok {
|
||||||
|
return nil, ErrorCantMove
|
||||||
|
}
|
||||||
|
return fMove.Move(src, remote)
|
||||||
|
}
|
||||||
|
|
||||||
// Check the interfaces are satisfied
|
// Check the interfaces are satisfied
|
||||||
var _ Fs = &Limited{}
|
var (
|
||||||
var _ Copier = &Limited{}
|
_ Fs = (*Limited)(nil)
|
||||||
|
_ Copier = (*Limited)(nil)
|
||||||
|
_ Mover = (*Limited)(nil)
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue