|
|
@ -31,6 +31,7 @@ func (s s3RemoteStorageMaker) HasBucket() bool { |
|
|
|
|
|
|
|
func (s s3RemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.RemoteStorageClient, error) { |
|
|
|
client := &s3RemoteStorageClient{ |
|
|
|
supportTagging: true, |
|
|
|
conf: conf, |
|
|
|
} |
|
|
|
config := &aws.Config{ |
|
|
@ -61,9 +62,10 @@ func (s s3RemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage.R |
|
|
|
type s3RemoteStorageClient struct { |
|
|
|
conf *remote_pb.RemoteConf |
|
|
|
conn s3iface.S3API |
|
|
|
supportTagging bool |
|
|
|
} |
|
|
|
|
|
|
|
var _ = remote_storage.RemoteStorageClient(&s3RemoteStorageClient{}) |
|
|
|
var _ = remote_storage.RemoteStorageClient(&s3RemoteStorageClient{supportTagging: true}) |
|
|
|
|
|
|
|
func (s *s3RemoteStorageClient) Traverse(remote *remote_pb.RemoteStorageLocation, visitFn remote_storage.VisitFunc) (err error) { |
|
|
|
|
|
|
@ -158,12 +160,14 @@ func (s *s3RemoteStorageClient) WriteFile(loc *remote_pb.RemoteStorageLocation, |
|
|
|
|
|
|
|
// process tagging
|
|
|
|
tags := "" |
|
|
|
if s.supportTagging { |
|
|
|
for k, v := range entry.Extended { |
|
|
|
if len(tags) > 0 { |
|
|
|
tags = tags + "&" |
|
|
|
} |
|
|
|
tags = tags + k + "=" + string(v) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Upload the file to S3.
|
|
|
|
_, err = uploader.Upload(&s3manager.UploadInput{ |
|
|
|