copy: use server side copy if available

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-01-07 16:28:46 +01:00
parent 09dea57850
commit 93e5cb36df
7 changed files with 58 additions and 5 deletions

View File

@@ -687,6 +687,11 @@ func (fs *GCSFs) ResolvePath(virtualPath string) (string, error) {
return fs.Join(fs.config.KeyPrefix, strings.TrimPrefix(virtualPath, "/")), nil
}
// CopyFile implements the FsFileCopier interface
func (fs *GCSFs) CopyFile(source, target string, srcSize int64) error {
return fs.copyFileInternal(source, target)
}
func (fs *GCSFs) resolve(name, prefix, contentType string) (string, bool) {
result := strings.TrimPrefix(name, prefix)
isDir := strings.HasSuffix(result, "/")