Skip to content

Commit

Permalink
Merge pull request #20 from qor/s3-copy-object
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfmin authored Jul 14, 2023
2 parents 3c5583a + c034137 commit 1ebd533
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,13 @@ func (client Client) GetURL(path string) (url string, err error) {

return path, nil
}

// Copy copy s3 file from "from" to "to"
func (client Client) Copy(from, to string) (err error) {
_, err = client.S3.CopyObject(&s3.CopyObjectInput{
Bucket: aws.String(client.Config.Bucket),
CopySource: aws.String(from),
Key: aws.String(to),
})
return
}

0 comments on commit 1ebd533

Please sign in to comment.