|
|
@ -18,12 +18,18 @@ package main |
|
|
|
|
|
|
|
|
|
|
|
import "encoding/xml" |
|
|
|
import "encoding/xml" |
|
|
|
|
|
|
|
|
|
|
|
// Limit number of objects in a given response
|
|
|
|
// Limit number of objects in a given response.
|
|
|
|
const ( |
|
|
|
const ( |
|
|
|
maxObjectList = 1000 |
|
|
|
maxObjectList = 1000 |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// AccessControlPolicyResponse - format for get bucket acl response
|
|
|
|
// LocationResponse - format for location response.
|
|
|
|
|
|
|
|
type LocationResponse struct { |
|
|
|
|
|
|
|
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LocationConstraint" json:"-"` |
|
|
|
|
|
|
|
Location string `xml:",chardata"` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// AccessControlPolicyResponse - format for get bucket acl response.
|
|
|
|
type AccessControlPolicyResponse struct { |
|
|
|
type AccessControlPolicyResponse struct { |
|
|
|
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlPolicy" json:"-"` |
|
|
|
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlPolicy" json:"-"` |
|
|
|
|
|
|
|
|
|
|
@ -33,7 +39,7 @@ type AccessControlPolicyResponse struct { |
|
|
|
Owner Owner |
|
|
|
Owner Owner |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Grant container for grantee and permission
|
|
|
|
// Grant container for grantee and permission.
|
|
|
|
type Grant struct { |
|
|
|
type Grant struct { |
|
|
|
Grantee struct { |
|
|
|
Grantee struct { |
|
|
|
ID string |
|
|
|
ID string |
|
|
@ -45,7 +51,7 @@ type Grant struct { |
|
|
|
Permission string |
|
|
|
Permission string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ListObjectsResponse - format for list objects response
|
|
|
|
// ListObjectsResponse - format for list objects response.
|
|
|
|
type ListObjectsResponse struct { |
|
|
|
type ListObjectsResponse struct { |
|
|
|
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListBucketResult" json:"-"` |
|
|
|
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListBucketResult" json:"-"` |
|
|
|
|
|
|
|
|
|
|
@ -75,7 +81,7 @@ type ListObjectsResponse struct { |
|
|
|
Prefix string |
|
|
|
Prefix string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Part container for part metadata
|
|
|
|
// Part container for part metadata.
|
|
|
|
type Part struct { |
|
|
|
type Part struct { |
|
|
|
PartNumber int |
|
|
|
PartNumber int |
|
|
|
ETag string |
|
|
|
ETag string |
|
|
@ -83,7 +89,7 @@ type Part struct { |
|
|
|
Size int64 |
|
|
|
Size int64 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ListPartsResponse - format for list parts response
|
|
|
|
// ListPartsResponse - format for list parts response.
|
|
|
|
type ListPartsResponse struct { |
|
|
|
type ListPartsResponse struct { |
|
|
|
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListPartsResult" json:"-"` |
|
|
|
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListPartsResult" json:"-"` |
|
|
|
|
|
|
|
|
|
|
@ -102,11 +108,11 @@ type ListPartsResponse struct { |
|
|
|
MaxParts int |
|
|
|
MaxParts int |
|
|
|
IsTruncated bool |
|
|
|
IsTruncated bool |
|
|
|
|
|
|
|
|
|
|
|
// List of parts
|
|
|
|
// List of parts.
|
|
|
|
Part []*Part |
|
|
|
Part []*Part |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ListMultipartUploadsResponse - format for list multipart uploads response
|
|
|
|
// ListMultipartUploadsResponse - format for list multipart uploads response.
|
|
|
|
type ListMultipartUploadsResponse struct { |
|
|
|
type ListMultipartUploadsResponse struct { |
|
|
|
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListMultipartUploadsResult" json:"-"` |
|
|
|
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListMultipartUploadsResult" json:"-"` |
|
|
|
|
|
|
|
|
|
|
|