AWS S3 PUT方法参数由Goamz



早些时但是对于我的新项目,我正在使用" github.com/goamz/goamz/s3"。现在有一个更改的buck的方法,现在它具有更多的param" options"

region := aws.USEast2
connection := s3.New(AWSAuth, region)
bucket := connection.Bucket("XXXXX") // change this your bucket name
path := "mypath" // this is the target file and location in S3
//Save image to s3
err = bucket.Put(path,user_content,content_type, s3.ACL("public-read"), options)

上面是我的代码。您能帮我期望的期望以及如何获得价值吗?

选项在s3.go中定义:

type Options struct {
    SSE              bool
    Meta             map[string][]string
    ContentEncoding  string
    CacheControl     string
    RedirectLocation string
    ContentMD5       string
    // What else?
    // Content-Disposition string
    //// The following become headers so they are []strings rather than strings... I think
    // x-amz-storage-class []string
}

这些选项已在官方的S3 API文档中得到充分记录。

在最简单的情况下,您只能传递任何东西。例如: bucket.Put(path,user_content,content_type, s3.ACL("public-read"), s3.Options{})

最新更新