本文整理汇总了Golang中github.com/convox/kernel/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/s3.S3类的典型用法代码示例。如果您正苦于以下问题:Golang S3类的具体用法?Golang S3怎么用?Golang S3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了S3类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: runTests
func runTests(t *testing.T, svc *s3.S3, tests []s3BucketTest) {
for _, test := range tests {
req, _ := svc.ListObjectsRequest(&s3.ListObjectsInput{Bucket: &test.bucket})
req.Build()
assert.Equal(t, test.url, req.HTTPRequest.URL.String())
}
}
示例2: cleanupBucketObject
func cleanupBucketObject(bucket, key, version string, S3 *s3.S3) {
req := &s3.DeleteObjectInput{
Bucket: aws.String(bucket),
Key: aws.String(key),
VersionID: aws.String(version),
}
_, err := S3.DeleteObject(req)
if err != nil {
fmt.Printf("error: %s\n", err)
}
}
示例3: cleanupBucket
func cleanupBucket(bucket string, S3 *s3.S3) error {
req := &s3.ListObjectVersionsInput{
Bucket: aws.String(bucket),
}
res, err := S3.ListObjectVersions(req)
if err != nil {
return err
}
for _, d := range res.DeleteMarkers {
go cleanupBucketObject(bucket, *d.Key, *d.VersionID, S3)
}
for _, v := range res.Versions {
go cleanupBucketObject(bucket, *v.Key, *v.VersionID, S3)
}
return nil
}