add documentation for move func, add rename function as a wrapper for move

This commit is contained in:
Shane C. 2024-11-19 09:24:58 -05:00
parent 222b66c2f2
commit f14c451ea8
Signed by: Shane C.
GPG key ID: E46B5FEA35B22FF9

View file

@ -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 {
if s.s3Client != nil {
if _, err := s.s3Client.CopyObject(s.ctx, minio.CopyDestOptions{