Documentation ¶
Index ¶
- Constants
- Variables
- func IsValidCannedAcl(acl Acl) (err error)
- func ParseAmzDate(amzDateStr string) (amzDate time.Time, apiErr error)
- type AbortIncompleteMultipartUpload
- type AccessControlPolicy
- type AccessControlPolicyResponse
- type Acl
- type AppendObjectResult
- type Bucket
- type CommonPrefix
- type CompleteMultipartResult
- type CompleteMultipartUploadResponse
- type CopyObjectPartResponse
- type CopyObjectResponse
- type CreateBucketLocationConfiguration
- type DeleteError
- type DeleteObjectResult
- type DeleteObjectsRequest
- type Expiration
- type Grant
- type GrantResponse
- type Grantee
- type GranteeResponse
- type HttpRange
- type InitiateMultipartUploadResponse
- type Initiator
- type LifecycleConfiguration
- type ListBucketsResponse
- type ListMultipartUploadsResponse
- type ListObjectsRequest
- type ListObjectsResponse
- type ListPartsRequest
- type ListPartsResponse
- type ListUploadsRequest
- type LocationResponse
- type Object
- type ObjectIdentifier
- type Owner
- type Part
- type PostResponse
- type PutObjectPartResult
- type PutObjectResult
- type Rule
- type SSEConfiguration
- type SseRequest
- type Transition
- type Upload
- type VersionedListObjectsResponse
- type VersionedObject
- type VersioningConfiguration
Constants ¶
const ( CANNEDACL_PRIVATE = 0 CANNEDACL_PUBLIC_READ = 1 CANNEDACL_PUBLIC_READ_WRITE = 2 CANNEDACL_AWS_EXEC_READ = 3 CANNEDACL_AUTHENTICATED_READ = 4 CANNEDACL_BUCKET_OWNER_READ = 5 CANNEDACL_BUCKET_OWNER_FULL_CONTROLL = 6 )
const ( XMLNSXSI = "http://www.w3.org/2001/XMLSchema-instance" XMLNS = "http://s3.amazonaws.com/doc/2006-03-01/" )
const ( ACL_TYPE_CANON_USER = "CanonicalUser" ACL_TYPE_GROUP = "Group" )
const ( ACL_GROUP_TYPE_ALL_USERS = "http://acs.amazonaws.com/groups/global/AllUsers" ACL_GROUP_TYPE_AUTHENTICATED_USERS = "http://acs.amazonaws.com/groups/global/AuthenticatedUsers" )
const ( ACL_PERM_READ = "READ" ACL_PERM_WRITE = "WRITE" ACL_PERM_READ_ACP = "READ_ACP" ACL_PERM_WRITE_ACP = "WRITE_ACP" ACL_PERM_FULL_CONTROL = "FULL_CONTROL" )
const ( MaxObjectList = 1000 // Limit number of objects in a listObjectsResponse. MaxUploadsList = 1000 // Limit number of uploads in a listUploadsResponse. MaxPartsList = 1000 // Limit number of parts in a listPartsResponse. )
const ( Iso8601Format = "20060102T150405Z" YYYYMMDD = "20060102" PresignedUrlExpireLimit = 7 * 24 * time.Hour )
Variables ¶
var ErrorInvalidRange = errors.New("Invalid range")
ErrorInvalidRange - returned when given range value is not valid.
var ValidCannedAcl = []string{
"private",
"public-read",
"public-read-write",
}
Functions ¶
func IsValidCannedAcl ¶
Types ¶
type AbortIncompleteMultipartUpload ¶ added in v0.12.0
type AbortIncompleteMultipartUpload struct {
DaysAfterInitiation int32 `xml:"DaysAfterInitiation"`
}
type AccessControlPolicy ¶
type AccessControlPolicyResponse ¶
type AccessControlPolicyResponse struct { XMLName xml.Name `xml:"AccessControlPolicy"` Xmlns string `xml:"xmlns,attr,omitempty"` ID string `xml:"Owner>ID"` DisplayName string `xml:"Owner>DisplayName"` AccessControlList []GrantResponse `xml:"AccessControlList>Grant"` }
func CreatePolicyFromCanned ¶
func CreatePolicyFromCanned(owner Owner, bucketOwner Owner, acl Acl) ( policy AccessControlPolicyResponse, err error)
type Acl ¶
type Acl struct {
CannedAcl string
}
func GetCannedAclFromPolicy ¶
func GetCannedAclFromPolicy(policy AccessControlPolicy) (acl Acl, err error)
the function will be deleted, because we will use AccessControlPolicy instead canned acl stored in hbase
type AppendObjectResult ¶
type AppendObjectResult struct { PutObjectResult NextPosition int64 }
type Bucket ¶
type Bucket struct { Name string CreationDate string // time string of format "2006-01-02T15:04:05.000Z" LocationConstraint string VersionOpts VersioningConfiguration SSEOpts SSEConfiguration }
Bucket container for bucket metadata
type CommonPrefix ¶
CommonPrefix container for prefix response in ListObjectsResponse
type CompleteMultipartResult ¶
type CompleteMultipartUploadResponse ¶
type CompleteMultipartUploadResponse struct { XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CompleteMultipartUploadResult" json:"-"` Location string Bucket string Key string ETag string }
CompleteMultipartUploadResponse container for completed multipart upload response
type CopyObjectPartResponse ¶
type CopyObjectResponse ¶
type CopyObjectResponse struct { XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopyObjectResult" json:"-"` ETag string LastModified string // time string of format "2006-01-02T15:04:05.000Z" }
CopyObjectResponse container returns ETag and LastModified of the successfully copied object
type CreateBucketLocationConfiguration ¶
type CreateBucketLocationConfiguration struct { XMLName xml.Name `xml:"CreateBucketConfiguration" json:"-"` Location string `xml:"LocationConstraint"` }
createBucketConfiguration container for bucket configuration request from client. Used for parsing the location from the request body for MakeBucket.
type DeleteError ¶
type DeleteError struct { Code string Message string Key string VersionId string `xml:",omitempty"` }
DeleteError structure.
type DeleteObjectResult ¶
type DeleteObjectsRequest ¶
type DeleteObjectsRequest struct { XMLName xml.Name `xml:"Delete"` // Element to enable quiet mode for the request Quiet bool // List of objects to be deleted Objects []ObjectIdentifier `xml:"Object"` }
DeleteObjectsRequest - xml carrying the object key names which needs to be deleted.
type Expiration ¶ added in v0.12.0
type Expiration struct {
Days int32 `xml:"Days"`
}
type GrantResponse ¶
type GrantResponse struct { XMLName xml.Name `xml:"Grant"` Grantee GranteeResponse `xml:"Grantee"` Permission string `xml:"Permission"` }
type Grantee ¶
type Grantee struct { XMLName xml.Name `xml:"Grantee"` XmlnsXsi string `xml:"xmlns:xsi,attr"` XsiType string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"` URI string `xml:"URI,omitempty"` ID string `xml:"ID,omitempty"` DisplayName string `xml:"DisplayName,omitempty"` EmailAddress string `xml:"EmailAddress,omitempty"` }
type GranteeResponse ¶
type GranteeResponse struct { XMLName xml.Name `xml:"Grantee"` XmlnsXsi string `xml:"xmlns:xsi,attr"` XsiType string `xml:"xsi:type,attr"` URI string `xml:"URI,omitempty"` ID string `xml:"ID,omitempty"` DisplayName string `xml:"DisplayName,omitempty"` EmailAddress string `xml:"EmailAddress,omitempty"` }
type HttpRange ¶
HttpRange specifies the byte range to be sent to the client.
func ParseRequestRange ¶
type InitiateMultipartUploadResponse ¶
type InitiateMultipartUploadResponse struct { XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ InitiateMultipartUploadResult" json:"-"` Bucket string Key string UploadID string `xml:"UploadId"` }
InitiateMultipartUploadResponse container for InitiateMultiPartUpload response, provides uploadID to start MultiPart upload
type LifecycleConfiguration ¶ added in v0.12.0
type LifecycleConfiguration struct {
Rule []Rule `xml:"Rule"`
}
type ListBucketsResponse ¶
type ListBucketsResponse struct { XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListAllMyBucketsResult" json:"-"` Owner Owner // Container for one or more buckets. Buckets struct { Buckets []Bucket `xml:"Bucket"` } // Buckets are nested }
ListBucketsResponse - format for list buckets response
type ListMultipartUploadsResponse ¶
type ListMultipartUploadsResponse struct { XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListMultipartUploadsResult" json:"-"` Bucket string KeyMarker string UploadIdMarker string NextKeyMarker string NextUploadIdMarker string EncodingType string `xml:"Encoding-Type,omitempty"` MaxUploads int IsTruncated bool Uploads []Upload `xml:"Upload"` Prefix string Delimiter string CommonPrefixes []CommonPrefix }
ListMultipartUploadsResponse - format for list multipart uploads response.
type ListObjectsRequest ¶
type ListObjectsRequest struct { Versioned bool // should return versioned objects? Version int // Currently 1 or 2 Delimiter string EncodingType string MaxKeys int Prefix string // v1 specific Marker string // v2 specific ContinuationToken string StartAfter string FetchOwner bool // versioned specific KeyMarker string VersionIdMarker string }
type ListObjectsResponse ¶
type ListObjectsResponse struct { XMLName xml.Name `xml:"ListBucketResult"` CommonPrefixes []CommonPrefix Delimiter string `xml:"Delimiter,omitempty"` EncodingType string `xml:"EncodingType,omitempty"` IsTruncated bool MaxKeys int KeyCount int `xml:",omitempty"` Prefix string BucketName string `xml:"Name"` // v1 specific Marker string NextMarker string `xml:",omitempty"` // v2 specific ContinuationToken string `xml:",omitempty"` NextContinuationToken string `xml:",omitempty"` StartAfter string `xml:",omitempty"` Contents []Object }
type ListPartsRequest ¶
type ListPartsResponse ¶
type ListPartsResponse struct { XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListPartsResult" json:"-"` Bucket string Key string UploadId string EncodingType string `xml:"Encoding-Type,omitempty"` Initiator Initiator Owner Owner // The class of storage used to store the object. StorageClass string PartNumberMarker int NextPartNumberMarker int MaxParts int IsTruncated bool // List of parts. Parts []Part `xml:"Part"` }
ListPartsResponse - format for list parts response.
type ListUploadsRequest ¶
type LocationResponse ¶
type LocationResponse struct { XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LocationConstraint" json:"-"` Location string `xml:",chardata"` }
LocationResponse - format for location response.
type Object ¶
type Object struct { XMLName xml.Name `xml:"Contents"` Key string LastModified string // time string of format "2006-01-02T15:04:05.000Z" ETag string Size int64 Owner *Owner `xml:"Owner,omitempty"` // The class of storage used to store the object. StorageClass string Location string Tier int32 }
Object container for object metadata
type ObjectIdentifier ¶
type ObjectIdentifier struct { ObjectName string `xml:"Key"` VersionId string `xml:",omitempty"` DeleteMarker bool `xml:",omitempty"` DeleteMarkerVersionId string `xml:",omitempty"` }
ObjectIdentifier carries key name for the object to delete.
type PostResponse ¶
type PostResponse struct { XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ PostResponse" json:"-"` Location string Bucket string Key string ETag string }
PostResponse container for completed post upload response
type PutObjectPartResult ¶
type PutObjectResult ¶
type Rule ¶ added in v0.12.0
type Rule struct { ID string `xml:"ID"` Prefix string `xml:"Prefix,omitempty"` Status string `xml:"Status"` Transition []Transition `xml:"Transition,omitempty"` Expiration []Expiration `xml:"Expiration,omitempty"` AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `xml:"AbortIncompleteMultipartUpload,omitempty"` }
type SSEConfiguration ¶ added in v0.12.0
type SSEConfiguration struct { XMLName xml.Name `xml:"SSEConfiguration"` Text string `xml:",chardata"` SSE struct { Text string `xml:",chardata"` Enabled string `xml:"enabled"` } `xml:"SSE"` SSEKMS struct { Text string `xml:",chardata"` Enabled string `xml:"enabled"` DefaultKMSMasterKey string `xml:"DefaultKMSMasterKey"` } `xml:"SSE-KMS"` }
added for soda
type SseRequest ¶
type SseRequest struct { // type of Server Side Encryption, could be "SSE-KMS", "SSE-S3", "SSE-C"(custom), or ""(none), // KMS is not implemented yet Type string // AWS-managed specific(KMS and S3) SseAwsKmsKeyId string SseContext string // customer-provided specific(SSE-C) SseCustomerAlgorithm string SseCustomerKey []byte // keys for copy CopySourceSseCustomerAlgorithm string CopySourceSseCustomerKey []byte }
type Transition ¶ added in v0.12.0
type Upload ¶
type Upload struct { Key string UploadId string Initiator Initiator Owner Owner StorageClass string Initiated string // time string of format "2006-01-02T15:04:05.000Z" }
Upload container for in progress multipart upload
type VersionedListObjectsResponse ¶
type VersionedListObjectsResponse struct { XMLName xml.Name `xml:"ListVersionsResult"` Contents []VersionedObject CommonPrefixes []CommonPrefix Delimiter string EncodingType string `xml:"Encoding-Type,omitempty"` IsTruncated bool MaxKeys int KeyCount int Prefix string BucketName string `xml:"Name"` KeyMarker string NextKeyMarker string VersionIdMarker string NextVersionIdMarker string }
type VersionedObject ¶
type VersioningConfiguration ¶ added in v0.12.0
type VersioningConfiguration struct { XMLName xml.Name `xml:"VersioningConfiguration"` Status string `xml:"Status"` }
added for soda