MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / copyFile

Method copyFile

drivers/s3/util.go:217–228  ·  view source on GitHub ↗
(ctx context.Context, src string, dst string)

Source from the content-addressed store, hash-verified

215}
216
217func (d *S3) copyFile(ctx context.Context, src string, dst string) error {
218 srcKey := getKey(src, false)
219 dstKey := getKey(dst, false)
220 encodedKey := strings.ReplaceAll(url.PathEscape(d.Bucket+"/"+srcKey), "+", "%2B")
221 input := &s3.CopyObjectInput{
222 Bucket: &d.Bucket,
223 CopySource: aws.String(encodedKey),
224 Key: &dstKey,
225 }
226 _, err := d.client.CopyObject(input)
227 return err
228}
229
230func (d *S3) copyDir(ctx context.Context, src string, dst string) error {
231 objs, err := op.List(ctx, d, src, model.ListArgs{S3ShowPlaceholder: true})

Callers 2

copyMethod · 0.95
copyDirMethod · 0.95

Calls 3

CopyObjectMethod · 0.80
getKeyFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected