seaweedfs/weed/replication/sink/s3sink/s3_write.go

26 lines
525 B
Go
Raw Normal View History

2018-10-04 06:36:52 +00:00
package S3Sink
import (
2018-10-11 07:08:13 +00:00
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/seaweedfs/seaweedfs/weed/glog"
2018-10-04 06:36:52 +00:00
)
func (s3sink *S3Sink) deleteObject(key string) error {
input := &s3.DeleteObjectInput{
Bucket: aws.String(s3sink.bucket),
Key: aws.String(key),
}
result, err := s3sink.conn.DeleteObject(input)
if err == nil {
2021-03-01 04:26:55 +00:00
glog.V(2).Infof("[%s] delete %s: %v", s3sink.bucket, key, result)
2018-10-04 06:36:52 +00:00
} else {
glog.Errorf("[%s] delete %s: %v", s3sink.bucket, key, err)
}
return err
}