Documentation
¶
Overview ¶
Package s3xml holds the XML request and response bodies of the S3 API and the helper to render them. The S3 API speaks XML, so any service implementing it needs these wire types; they carry no proxy logic.
Index ¶
- Constants
- func FormatTime(t time.Time) string
- func Write(w http.ResponseWriter, v any) error
- type AccessControlPolicy
- type AttributesChecksum
- type BucketEntry
- type CORSConfiguration
- type CORSRuleXML
- type CommonPrefix
- type CompleteMultipartUploadRequest
- type CompleteMultipartUploadResult
- type CompletePart
- type CopyObjectResult
- type CopyPartResult
- type DefaultRetention
- type DeleteError
- type DeleteMarkerEntry
- type DeleteRequest
- type DeleteRequestObject
- type DeleteResult
- type DeletedObject
- type GetObjectAttributesResult
- type Grant
- type Grantee
- type InitiateMultipartUploadResult
- type ListAllMyBucketsResult
- type ListBucketResult
- type ListBucketResultV1
- type ListMultipartUploadsResult
- type ListPartsResult
- type ListVersionsResult
- type LocationConstraint
- type Object
- type ObjectAttributePart
- type ObjectAttributeParts
- type ObjectLockConfiguration
- type ObjectLockLegalHold
- type ObjectLockRetention
- type ObjectLockRule
- type ObjectVersion
- type Owner
- type OwnershipControls
- type OwnershipControlsRule
- type Part
- type PolicyStatus
- type PostResponse
- type PublicAccessBlockConfiguration
- type ServerSideEncryptionByDefault
- type ServerSideEncryptionConfiguration
- type ServerSideEncryptionRule
- type Tag
- type TagSet
- type Tagging
- type Upload
- type VersioningConfiguration
Constants ¶
const Namespace = "http://s3.amazonaws.com/doc/2006-03-01/"
Namespace is the XML namespace of S3 API documents.
Variables ¶
This section is empty.
Functions ¶
func FormatTime ¶
FormatTime formats a time the way S3 does in XML responses.
Types ¶
type AccessControlPolicy ¶
type AccessControlPolicy struct {
XMLName xml.Name `xml:"AccessControlPolicy"`
XMLNS string `xml:"xmlns,attr"`
Owner Owner `xml:"Owner"`
AccessControlList struct {
Grants []Grant `xml:"Grant"`
} `xml:"AccessControlList"`
}
AccessControlPolicy is the response of GetBucketAcl / GetObjectAcl.
type AttributesChecksum ¶ added in v0.0.5
type AttributesChecksum struct {
ChecksumCRC32 string `xml:"ChecksumCRC32,omitempty"`
ChecksumCRC32C string `xml:"ChecksumCRC32C,omitempty"`
ChecksumCRC64NVME string `xml:"ChecksumCRC64NVME,omitempty"`
ChecksumSHA1 string `xml:"ChecksumSHA1,omitempty"`
ChecksumSHA256 string `xml:"ChecksumSHA256,omitempty"`
ChecksumType string `xml:"ChecksumType,omitempty"`
}
AttributesChecksum is the Checksum member of GetObjectAttributesResult.
type BucketEntry ¶
type CORSConfiguration ¶
type CORSConfiguration struct {
XMLName xml.Name `xml:"CORSConfiguration"`
XMLNS string `xml:"xmlns,attr"`
Rules []CORSRuleXML `xml:"CORSRule"`
}
CORSConfiguration is the response of GetBucketCors.
type CORSRuleXML ¶
type CommonPrefix ¶
type CommonPrefix struct {
Prefix string `xml:"Prefix"`
}
type CompleteMultipartUploadRequest ¶
type CompleteMultipartUploadRequest struct {
XMLName xml.Name `xml:"CompleteMultipartUpload"`
Parts []CompletePart `xml:"Part"`
}
CompleteMultipartUploadRequest is the request body of CompleteMultipartUpload.
type CompleteMultipartUploadResult ¶
type CompleteMultipartUploadResult struct {
XMLName xml.Name `xml:"CompleteMultipartUploadResult"`
XMLNS string `xml:"xmlns,attr"`
Location string `xml:"Location"`
Bucket string `xml:"Bucket"`
Key string `xml:"Key"`
ETag string `xml:"ETag"`
ChecksumCRC32 string `xml:"ChecksumCRC32,omitempty"`
ChecksumCRC32C string `xml:"ChecksumCRC32C,omitempty"`
ChecksumCRC64NVME string `xml:"ChecksumCRC64NVME,omitempty"`
ChecksumSHA1 string `xml:"ChecksumSHA1,omitempty"`
ChecksumSHA256 string `xml:"ChecksumSHA256,omitempty"`
ChecksumType string `xml:"ChecksumType,omitempty"`
}
CompleteMultipartUploadResult is the response of CompleteMultipartUpload.
type CompletePart ¶
type CompletePart struct {
PartNumber int32 `xml:"PartNumber"`
ETag string `xml:"ETag"`
ChecksumCRC32 string `xml:"ChecksumCRC32,omitempty"`
ChecksumCRC32C string `xml:"ChecksumCRC32C,omitempty"`
ChecksumCRC64NVME string `xml:"ChecksumCRC64NVME,omitempty"`
ChecksumSHA1 string `xml:"ChecksumSHA1,omitempty"`
ChecksumSHA256 string `xml:"ChecksumSHA256,omitempty"`
}
type CopyObjectResult ¶
type CopyObjectResult struct {
XMLName xml.Name `xml:"CopyObjectResult"`
XMLNS string `xml:"xmlns,attr"`
ETag string `xml:"ETag"`
LastModified string `xml:"LastModified,omitempty"`
}
CopyObjectResult is the response of CopyObject.
type CopyPartResult ¶
type CopyPartResult struct {
XMLName xml.Name `xml:"CopyPartResult"`
XMLNS string `xml:"xmlns,attr"`
ETag string `xml:"ETag"`
LastModified string `xml:"LastModified,omitempty"`
}
CopyPartResult is the response of UploadPartCopy.
type DefaultRetention ¶
type DeleteError ¶
type DeleteMarkerEntry ¶
type DeleteRequest ¶
type DeleteRequest struct {
XMLName xml.Name `xml:"Delete"`
Quiet bool `xml:"Quiet"`
Objects []DeleteRequestObject `xml:"Object"`
}
DeleteRequest is the request body of DeleteObjects (Multi-Object Delete).
type DeleteRequestObject ¶
type DeleteResult ¶
type DeleteResult struct {
XMLName xml.Name `xml:"DeleteResult"`
XMLNS string `xml:"xmlns,attr"`
Deleted []DeletedObject `xml:"Deleted"`
Errors []DeleteError `xml:"Error"`
}
DeleteResult is the response of DeleteObjects.
type DeletedObject ¶
type GetObjectAttributesResult ¶ added in v0.0.5
type GetObjectAttributesResult struct {
XMLName xml.Name `xml:"GetObjectAttributesResponse"`
XMLNS string `xml:"xmlns,attr"`
ETag string `xml:"ETag,omitempty"`
Checksum *AttributesChecksum `xml:"Checksum,omitempty"`
ObjectParts *ObjectAttributeParts `xml:"ObjectParts,omitempty"`
StorageClass string `xml:"StorageClass,omitempty"`
ObjectSize *int64 `xml:"ObjectSize,omitempty"`
}
GetObjectAttributesResult is the response of GetObjectAttributes. Only the attributes the request asked for are present. Note this API returns the ETag without quotes, unlike every other S3 response.
type InitiateMultipartUploadResult ¶
type InitiateMultipartUploadResult struct {
XMLName xml.Name `xml:"InitiateMultipartUploadResult"`
XMLNS string `xml:"xmlns,attr"`
Bucket string `xml:"Bucket"`
Key string `xml:"Key"`
UploadID string `xml:"UploadId"`
}
InitiateMultipartUploadResult is the response of CreateMultipartUpload.
type ListAllMyBucketsResult ¶
type ListAllMyBucketsResult struct {
XMLName xml.Name `xml:"ListAllMyBucketsResult"`
XMLNS string `xml:"xmlns,attr"`
Owner Owner `xml:"Owner"`
Buckets struct {
Bucket []BucketEntry `xml:"Bucket"`
} `xml:"Buckets"`
// ContinuationToken is the token for the next page, present only when
// the listing is truncated.
ContinuationToken string `xml:"ContinuationToken,omitempty"`
}
ListAllMyBucketsResult is the response of ListBuckets.
type ListBucketResult ¶
type ListBucketResult struct {
XMLName xml.Name `xml:"ListBucketResult"`
XMLNS string `xml:"xmlns,attr"`
Name string `xml:"Name"`
Prefix string `xml:"Prefix"`
StartAfter string `xml:"StartAfter,omitempty"`
// ContinuationToken echoes the request's token; a pointer so a
// supplied-but-empty token is echoed as an empty element rather than
// omitted.
ContinuationToken *string `xml:"ContinuationToken,omitempty"`
NextContinuationToken string `xml:"NextContinuationToken,omitempty"`
KeyCount int32 `xml:"KeyCount"`
MaxKeys int32 `xml:"MaxKeys"`
Delimiter string `xml:"Delimiter,omitempty"`
EncodingType string `xml:"EncodingType,omitempty"`
IsTruncated bool `xml:"IsTruncated"`
Contents []Object `xml:"Contents"`
CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"`
}
ListBucketResult is the response of ListObjectsV2.
type ListBucketResultV1 ¶
type ListBucketResultV1 struct {
XMLName xml.Name `xml:"ListBucketResult"`
XMLNS string `xml:"xmlns,attr"`
Name string `xml:"Name"`
Prefix string `xml:"Prefix"`
Marker string `xml:"Marker"`
NextMarker string `xml:"NextMarker,omitempty"`
MaxKeys int32 `xml:"MaxKeys"`
Delimiter string `xml:"Delimiter,omitempty"`
EncodingType string `xml:"EncodingType,omitempty"`
IsTruncated bool `xml:"IsTruncated"`
Contents []Object `xml:"Contents"`
CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"`
}
ListBucketResultV1 is the response of ListObjects (version 1).
type ListMultipartUploadsResult ¶
type ListMultipartUploadsResult struct {
XMLName xml.Name `xml:"ListMultipartUploadsResult"`
XMLNS string `xml:"xmlns,attr"`
Bucket string `xml:"Bucket"`
KeyMarker string `xml:"KeyMarker,omitempty"`
UploadIDMarker string `xml:"UploadIdMarker,omitempty"`
NextKeyMarker string `xml:"NextKeyMarker,omitempty"`
NextUploadIDMarker string `xml:"NextUploadIdMarker,omitempty"`
Delimiter string `xml:"Delimiter,omitempty"`
Prefix string `xml:"Prefix,omitempty"`
MaxUploads int32 `xml:"MaxUploads"`
IsTruncated bool `xml:"IsTruncated"`
Uploads []Upload `xml:"Upload"`
CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"`
}
ListMultipartUploadsResult is the response of ListMultipartUploads.
type ListPartsResult ¶
type ListPartsResult struct {
XMLName xml.Name `xml:"ListPartsResult"`
XMLNS string `xml:"xmlns,attr"`
Bucket string `xml:"Bucket"`
Key string `xml:"Key"`
UploadID string `xml:"UploadId"`
PartNumberMarker string `xml:"PartNumberMarker,omitempty"`
NextPartNumberMarker string `xml:"NextPartNumberMarker,omitempty"`
MaxParts int32 `xml:"MaxParts"`
IsTruncated bool `xml:"IsTruncated"`
Parts []Part `xml:"Part"`
Initiator *Owner `xml:"Initiator,omitempty"`
Owner *Owner `xml:"Owner,omitempty"`
StorageClass string `xml:"StorageClass,omitempty"`
}
ListPartsResult is the response of ListParts.
type ListVersionsResult ¶
type ListVersionsResult struct {
XMLName xml.Name `xml:"ListVersionsResult"`
XMLNS string `xml:"xmlns,attr"`
Name string `xml:"Name"`
Prefix string `xml:"Prefix"`
KeyMarker string `xml:"KeyMarker"`
VersionIDMarker string `xml:"VersionIdMarker"`
NextKeyMarker string `xml:"NextKeyMarker,omitempty"`
NextVersionIDMarker string `xml:"NextVersionIdMarker,omitempty"`
MaxKeys int32 `xml:"MaxKeys"`
Delimiter string `xml:"Delimiter,omitempty"`
EncodingType string `xml:"EncodingType,omitempty"`
IsTruncated bool `xml:"IsTruncated"`
Versions []ObjectVersion `xml:"Version"`
DeleteMarkers []DeleteMarkerEntry `xml:"DeleteMarker"`
CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"`
}
ListVersionsResult is the response of ListObjectVersions.
type LocationConstraint ¶
type LocationConstraint struct {
XMLName xml.Name `xml:"LocationConstraint"`
XMLNS string `xml:"xmlns,attr"`
Value string `xml:",chardata"`
}
LocationConstraint is the response of GetBucketLocation.
type ObjectAttributePart ¶ added in v0.0.5
type ObjectAttributePart struct {
PartNumber int32 `xml:"PartNumber"`
Size int64 `xml:"Size"`
ChecksumCRC32 string `xml:"ChecksumCRC32,omitempty"`
ChecksumCRC32C string `xml:"ChecksumCRC32C,omitempty"`
ChecksumCRC64NVME string `xml:"ChecksumCRC64NVME,omitempty"`
ChecksumSHA1 string `xml:"ChecksumSHA1,omitempty"`
ChecksumSHA256 string `xml:"ChecksumSHA256,omitempty"`
}
ObjectAttributePart is one part of ObjectAttributeParts.
type ObjectAttributeParts ¶ added in v0.0.5
type ObjectAttributeParts struct {
IsTruncated bool `xml:"IsTruncated"`
MaxParts *int32 `xml:"MaxParts,omitempty"`
NextPartNumberMarker string `xml:"NextPartNumberMarker,omitempty"`
PartNumberMarker string `xml:"PartNumberMarker,omitempty"`
PartsCount *int32 `xml:"PartsCount,omitempty"`
Parts []ObjectAttributePart `xml:"Part"`
}
ObjectAttributeParts is the ObjectParts member of GetObjectAttributesResult.
type ObjectLockConfiguration ¶
type ObjectLockConfiguration struct {
XMLName xml.Name `xml:"ObjectLockConfiguration"`
XMLNS string `xml:"xmlns,attr,omitempty"`
ObjectLockEnabled string `xml:"ObjectLockEnabled,omitempty"`
Rule *ObjectLockRule `xml:"Rule,omitempty"`
}
ObjectLockConfiguration is the request/response body of Put/GetObjectLockConfiguration.
type ObjectLockLegalHold ¶
type ObjectLockLegalHold struct {
XMLName xml.Name `xml:"LegalHold"`
XMLNS string `xml:"xmlns,attr,omitempty"`
Status string `xml:"Status,omitempty"`
}
ObjectLockLegalHold is the request/response body of Put/GetObjectLegalHold.
type ObjectLockRetention ¶
type ObjectLockRetention struct {
XMLName xml.Name `xml:"Retention"`
XMLNS string `xml:"xmlns,attr,omitempty"`
Mode string `xml:"Mode,omitempty"`
RetainUntilDate string `xml:"RetainUntilDate,omitempty"`
}
ObjectLockRetention is the request/response body of Put/GetObjectRetention.
type ObjectLockRule ¶
type ObjectLockRule struct {
DefaultRetention *DefaultRetention `xml:"DefaultRetention,omitempty"`
}
type ObjectVersion ¶
type ObjectVersion struct {
Key string `xml:"Key"`
VersionID string `xml:"VersionId"`
IsLatest bool `xml:"IsLatest"`
LastModified string `xml:"LastModified,omitempty"`
ETag string `xml:"ETag"`
Size int64 `xml:"Size"`
StorageClass string `xml:"StorageClass,omitempty"`
Owner *Owner `xml:"Owner,omitempty"`
}
type OwnershipControls ¶ added in v0.0.10
type OwnershipControls struct {
XMLName xml.Name `xml:"OwnershipControls"`
XMLNS string `xml:"xmlns,attr,omitempty"`
Rules []OwnershipControlsRule `xml:"Rule"`
}
OwnershipControls is the request/response body of Put/GetBucketOwnershipControls.
type OwnershipControlsRule ¶ added in v0.0.10
type OwnershipControlsRule struct {
ObjectOwnership string `xml:"ObjectOwnership"`
}
type PolicyStatus ¶ added in v0.0.10
type PolicyStatus struct {
XMLName xml.Name `xml:"PolicyStatus"`
XMLNS string `xml:"xmlns,attr,omitempty"`
IsPublic bool `xml:"IsPublic"`
}
PolicyStatus is the response of GetBucketPolicyStatus.
type PostResponse ¶ added in v0.0.3
type PostResponse struct {
XMLName xml.Name `xml:"PostResponse"`
XMLNS string `xml:"xmlns,attr,omitempty"`
Location string `xml:"Location"`
Bucket string `xml:"Bucket"`
Key string `xml:"Key"`
ETag string `xml:"ETag"`
}
PostResponse is the body of a browser-based POST upload response when the form requests success_action_status 201.
type PublicAccessBlockConfiguration ¶ added in v0.0.10
type PublicAccessBlockConfiguration struct {
XMLName xml.Name `xml:"PublicAccessBlockConfiguration"`
XMLNS string `xml:"xmlns,attr,omitempty"`
BlockPublicAcls bool `xml:"BlockPublicAcls"`
IgnorePublicAcls bool `xml:"IgnorePublicAcls"`
BlockPublicPolicy bool `xml:"BlockPublicPolicy"`
RestrictPublicBuckets bool `xml:"RestrictPublicBuckets"`
}
PublicAccessBlockConfiguration is the request/response body of Put/GetPublicAccessBlock.
type ServerSideEncryptionByDefault ¶ added in v0.0.10
type ServerSideEncryptionConfiguration ¶ added in v0.0.10
type ServerSideEncryptionConfiguration struct {
XMLName xml.Name `xml:"ServerSideEncryptionConfiguration"`
XMLNS string `xml:"xmlns,attr,omitempty"`
Rules []ServerSideEncryptionRule `xml:"Rule"`
}
ServerSideEncryptionConfiguration is the request/response body of Put/GetBucketEncryption.
type ServerSideEncryptionRule ¶ added in v0.0.10
type ServerSideEncryptionRule struct {
ApplyServerSideEncryptionByDefault *ServerSideEncryptionByDefault `xml:"ApplyServerSideEncryptionByDefault,omitempty"`
BucketKeyEnabled *bool `xml:"BucketKeyEnabled,omitempty"`
}
type Tagging ¶
type Tagging struct {
XMLName xml.Name `xml:"Tagging"`
XMLNS string `xml:"xmlns,attr,omitempty"`
TagSet TagSet `xml:"TagSet"`
}
Tagging is the request and response body of PutObjectTagging / GetObjectTagging.
type VersioningConfiguration ¶
type VersioningConfiguration struct {
XMLName xml.Name `xml:"VersioningConfiguration"`
XMLNS string `xml:"xmlns,attr,omitempty"`
Status string `xml:"Status,omitempty"`
}
VersioningConfiguration is the request and response body of PutBucketVersioning / GetBucketVersioning.