Documentation ¶
Index ¶
- Constants
- type AccessControlList
- type AccessControlPolicy
- type Acl
- type ApiError
- type Bucket
- type Client
- func (client *Client) CompleteMultipartUpload(bucket, key, uploadId string, parts []*Part) (result *CompleteMultipartUploadResult, e error)
- func (client *Client) Copy(srcBucket, srcKey, tgtBucket, tgtKey string) error
- func (client *Client) Delete(bucket, key string) error
- func (client *Client) Endpoint() string
- func (client *Client) EndpointHost() string
- func (client *Client) Get(bucket, key string) (*http.Response, error)
- func (client *Client) Head(bucket, key string) (*http.Response, error)
- func (client *Client) InitiateMultipartUpload(bucket, key string, opts *PutOptions) (result *InitiateMultipartUploadResult, e error)
- func (client *Client) ListBucket(bucket string) (r *ListBucketResult, e error)
- func (client *Client) ListBucketWithOptions(bucket string, opts *ListBucketOptions) (r *ListBucketResult, e error)
- func (client *Client) Put(bucket, key string, data []byte, options *PutOptions) error
- func (client *Client) PutBucket(name string) error
- func (client *Client) PutMultipart(bucket, key string, f io.Reader, opts *MultipartOptions) (res *CompleteMultipartUploadResult, e error)
- func (client *Client) PutStream(bucket, key string, r io.Reader, options *PutOptions) error
- func (client *Client) Service() (r *ListAllMyBucketsResult, e error)
- func (client *Client) SignS3Request(req *http.Request, bucket string)
- func (client *Client) UploadPart(bucket, key string, data []byte, partId int, uploadId string) (part *Part, e error)
- type CommonPrefixes
- type CompleteMultipartUpload
- type CompleteMultipartUploadResult
- type Content
- type Grant
- type InitiateMultipartUploadResult
- type ListAllMyBucketsResult
- type ListBucketOptions
- type ListBucketResult
- type ListVersions
- type ListVersionsResult
- type MultipartOptions
- type Owner
- type Part
- type Policy
- type PolicyRequest
- type PolicyStatement
- type PutOptions
- type UploadPartResult
- type User
- type Version
Constants ¶
View Source
const ( DEFAULT_ENDPOINT_HOST = "s3.amazonaws.com" HEADER_CONTENT_MD5 = "Content-Md5" HEADER_CONTENT_TYPE = "Content-Type" HEADER_DATE = "Date" HEADER_AUTHORIZATION = "Authorization" AMZ_ACL_PUBLIC = "public-read" DEFAULT_CONTENT_TYPE = "application/octet-stream" HEADER_AMZ_ACL = "x-amz-acl" HEADER_SERVER_SIDE_ENCRUPTION = "x-amz-server-side-encryption" AES256 = "AES256" )
View Source
const MinPartSize = 5 * 1024 * 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControlList ¶
type AccessControlList struct {
Grants []*Grant `xml:"Grant"`
}
type AccessControlPolicy ¶
type AccessControlPolicy struct { XMLname xml.Name `xml:"AccessControlPolicy"` Owner *User `xml:"Owner"` AccessControlList *AccessControlList `xml:"AccessControlList"` }
type ApiError ¶
type ApiError struct { Message string Request *http.Request Response *http.Response ResponseBody []byte }
func NewApiError ¶
type Client ¶
func NewFromEnv ¶
func NewFromEnv() *Client
func (*Client) CompleteMultipartUpload ¶
func (client *Client) CompleteMultipartUpload(bucket, key, uploadId string, parts []*Part) (result *CompleteMultipartUploadResult, e error)
func (*Client) EndpointHost ¶
func (*Client) InitiateMultipartUpload ¶
func (client *Client) InitiateMultipartUpload(bucket, key string, opts *PutOptions) (result *InitiateMultipartUploadResult, e error)
func (*Client) ListBucket ¶
func (client *Client) ListBucket(bucket string) (r *ListBucketResult, e error)
func (*Client) ListBucketWithOptions ¶
func (client *Client) ListBucketWithOptions(bucket string, opts *ListBucketOptions) (r *ListBucketResult, e error)
func (*Client) Put ¶
func (client *Client) Put(bucket, key string, data []byte, options *PutOptions) error
func (*Client) PutMultipart ¶
func (client *Client) PutMultipart(bucket, key string, f io.Reader, opts *MultipartOptions) (res *CompleteMultipartUploadResult, e error)
func (*Client) Service ¶
func (client *Client) Service() (r *ListAllMyBucketsResult, e error)
func (*Client) SignS3Request ¶
type CommonPrefixes ¶
type CommonPrefixes struct {
Prefix string `xml:"Prefix"`
}
type CompleteMultipartUpload ¶
type ListAllMyBucketsResult ¶
type ListBucketOptions ¶
type ListBucketResult ¶
type ListVersions ¶
type ListVersions struct { Bucket string // for parameter Delimiter string EncodingType string KeyMarker string MaxKeys string Prefix string VersionIdMarker string }
func (*ListVersions) Execute ¶
func (a *ListVersions) Execute(client *Client) (*ListVersionsResult, error)
type ListVersionsResult ¶
type ListVersionsResult struct { Name string `xml:"Name"` // example-bucket</Name> Prefix string `xml:"Prefix"` // photos/2006/</Prefix> KeyMarker string `xml:"KeyMarker"` // </KeyMarker> VersionIdMarker string `xml:"VersionIdMarker"` // </VersionIdMarker> MaxKeys int `xml:"MaxKeys"` // 1000</MaxKeys> Delimiter string `xml:"Delimiter"` // /</Delimiter> IsTruncated bool `xml:"IsTruncated"` // false</IsTruncated> CommonPrefixes []*CommonPrefixes `xml:"CommonPrefixes"` Versions []*Version `xml:"Version"` }
type MultipartOptions ¶
type MultipartOptions struct { *PutOptions PartSize int Callback func(*UploadPartResult) }
type Policy ¶
type Policy struct { Id string `json:"Id,omitempty"` Version string `json:"Version,omitempty"` Statements []*PolicyStatement `json:"Statement,omitempty"` }
type PolicyRequest ¶
func (*PolicyRequest) Load ¶
func (pr *PolicyRequest) Load(client *Client) (*AccessControlPolicy, error)
type PolicyStatement ¶
type PutOptions ¶
type PutOptions struct { ContentType string ContentLength int ContentEncoding string AmzAcl string ServerSideEncryption bool MetaHeader http.Header }
func NewPublicPut ¶
func NewPublicPut() *PutOptions
type UploadPartResult ¶
type Version ¶
type Version struct { Key string `xml:"Key"` // photos/2006/</Key> VersionId string `xml:"VersionId"` // 3U275dAA4gz8ZOqOPHtJCUOi60krpCdy</VersionId> IsLatest string `xml:"IsLatest"` // true</IsLatest> LastModified string `xml:"LastModified"` // 2011-02-02T18:47:27.000Z</LastModified> ETag string `xml:"ETag"` // "d41d8cd98f00b204e9800998ecf8427e"</ETag> Size string `xml:"Size"` // 0</Size> Owner *Owner `xml:"Owner"` StorageClass string `xml:"StorageClass"` // STANDARD</StorageClass> }
Click to show internal directories.
Click to hide internal directories.