Documentation ¶
Index ¶
- Constants
- func AuthorizationHeaderAccessKey(authorizationHeader string) string
- func BucketPolicy(bucketName string, roleName string) (json.RawMessage, error)
- func BucketPolicyRole(bucketName string, jsonPolicy string) (string, error)
- type Bucket
- type Error
- type ListAllMyBucketsResult
- type Owner
- type Policy
- type PolicyStatement
- type TransferManager
Constants ¶
const ErrorCodeInternalError = "InternalError"
ErrorCodeInternalError means there was an internal error.
const ErrorCodeInvalidAccessKeyID = "InvalidAccessKeyId"
ErrorCodeInvalidAccessKeyID means there was an invalid access key provided.
const ErrorCodeNoSuchBucket = "NoSuchBucket"
ErrorCodeNoSuchBucket means the specified bucket does not exist.
const ErrorInvalidRequest = "InvalidRequest"
ErrorInvalidRequest means there was an invalid request.
Variables ¶
This section is empty.
Functions ¶
func AuthorizationHeaderAccessKey ¶
AuthorizationHeaderAccessKey attempts to extract the (unverified) access key from the Authorization header.
func BucketPolicy ¶
func BucketPolicy(bucketName string, roleName string) (json.RawMessage, error)
BucketPolicy generates an S3 bucket policy for role.
Types ¶
type Error ¶
type Error struct { Code string Message string Resource string RequestID string `xml:"RequestId"` BucketName string `xml:"BucketName,omitempty"` HostID string `xml:"HostId"` }
Error S3 error response.
func (*Error) Response ¶
func (r *Error) Response(w http.ResponseWriter)
Response writes error as HTTP response.
type ListAllMyBucketsResult ¶
ListAllMyBucketsResult S3 list my buckets.
func (*ListAllMyBucketsResult) Response ¶
func (r *ListAllMyBucketsResult) Response(w http.ResponseWriter)
Response writes error as HTTP response.
type Policy ¶
type Policy struct { Version string Statement []PolicyStatement }
Policy defines the S3 policy.
type PolicyStatement ¶
PolicyStatement defines the S3 policy statement.
type TransferManager ¶
type TransferManager struct {
// contains filtered or unexported fields
}
TransferManager represents a transfer manager.
func NewTransferManager ¶
func NewTransferManager(s3URL *url.URL, accessKey string, secretKey string) TransferManager
NewTransferManager instantiates a new TransferManager struct.
func (TransferManager) DownloadAllFiles ¶
func (t TransferManager) DownloadAllFiles(bucketName string, tarWriter *instancewriter.InstanceTarWriter) error
DownloadAllFiles downloads all files from a bucket and writes them to a tar writer.
func (TransferManager) UploadAllFiles ¶
func (t TransferManager) UploadAllFiles(bucketName string, srcData io.ReadSeeker) error
UploadAllFiles uploads all the provided files to the bucket.