英文:
Unable to get s3.Object ACL using AWS SDK in go
问题
我正在尝试使用官方的示例列出一个存储桶中的对象。
err = svc.ListObjectsPages(&s3.ListObjectsInput{
Bucket: &bucketName,
}, func(p *s3.ListObjectsOutput, last bool) (shouldContinue bool) {
fmt.Println("Page,", i)
i++
for _, obj := range p.Contents {
fmt.Println("Object:", *obj.Key)
}
return true
})
然而,我发现s3.Object
类型没有与之关联的任何 ACL 信息。
我如何获取s3.Object
的 ACL 信息?
英文:
I am trying to list the objects of one bucket using the official example
err = svc.ListObjectsPages(&s3.ListObjectsInput{
Bucket: &bucketName,
}, func(p *s3.ListObjectsOutput, last bool) (shouldContinue bool) {
fmt.Println("Page,", i)
i++
for _, obj := range p.Contents {
fmt.Println("Object:", *obj.Key)
}
return true
})
However I see that the s3.Object
type does not have any ACL information associated with it.
How can I get the s3.Object
's ACL information?
答案1
得分: 1
请参考以下示例,了解如何使用AWS SDK for Go V2获取Amazon S3对象的ACL信息。
https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/gov2/s3/GetObjectAcl
英文:
Refer to this example to learn how to get an Amazon S3 object's ACL information using the AWS SDK for Go V2.
https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/gov2/s3/GetObjectAcl
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论