add documentation for move func, add rename function as a wrapper for move
This commit is contained in:
parent
222b66c2f2
commit
f14c451ea8
1 changed files with 8 additions and 0 deletions
|
@ -274,6 +274,14 @@ func (s *Storage) Copy(name string, dest string) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Rename is a wrapper over the Move function.
|
||||||
|
func (s *Storage) Rename(name, dest string) error {
|
||||||
|
return s.Move(name, dest)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Move moves a file from one place to another.
|
||||||
|
// It takes a file name, and the destination name as its parameter.
|
||||||
|
// The function returns an error, if any.
|
||||||
func (s *Storage) Move(name string, dest string) error {
|
func (s *Storage) Move(name string, dest string) error {
|
||||||
if s.s3Client != nil {
|
if s.s3Client != nil {
|
||||||
if _, err := s.s3Client.CopyObject(s.ctx, minio.CopyDestOptions{
|
if _, err := s.s3Client.CopyObject(s.ctx, minio.CopyDestOptions{
|
||||||
|
|
Loading…
Reference in a new issue