s3err

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidPolicyDocument invalidPolicyDocument
View Source
var MalformedAuth malformedAuthErrors
View Source
var PostAuth invalidPostAuthErr
View Source
var QueryAuthErrors queryAuthErrors

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code           string
	Description    string
	HTTPStatusCode int
}

APIError structure

func GetAPIError

func GetAPIError(code ErrorCode) APIError

GetAPIError provides API Error for input API error code.

func GetChecksumBadDigestErr added in v1.0.11

func GetChecksumBadDigestErr(algo types.ChecksumAlgorithm) APIError

Returns incorrect checksum APIError

func GetChecksumSchemaMismatchErr added in v1.0.11

func GetChecksumSchemaMismatchErr(algo types.ChecksumAlgorithm, t types.ChecksumType) APIError

Returns checksum type mismatch error with checksum algorithm

func GetChecksumTypeMismatchErr added in v1.0.11

func GetChecksumTypeMismatchErr(expected, actual types.ChecksumAlgorithm) APIError

Returns checksum type mismatch APIError

func GetChecksumTypeMismatchOnMpErr added in v1.0.11

func GetChecksumTypeMismatchOnMpErr(t types.ChecksumType) APIError

Returns checksum type mismatch error for multipart uploads

func GetCopySourceObjectTooLargeErr added in v1.4.0

func GetCopySourceObjectTooLargeErr(limit int64) APIError

func GetIncorrectMpObjectSizeErr added in v1.0.11

func GetIncorrectMpObjectSizeErr(expected, actual int64) APIError

func GetInvalidCORSHeaderErr added in v1.0.17

func GetInvalidCORSHeaderErr(header string) APIError

func GetInvalidCORSMethodErr added in v1.0.17

func GetInvalidCORSMethodErr(method string) APIError

func GetInvalidCORSRequestHeaderErr added in v1.0.17

func GetInvalidCORSRequestHeaderErr(header string) APIError

func GetInvalidChecksumHeaderErr added in v1.0.11

func GetInvalidChecksumHeaderErr(header string) APIError

Returns invalid checksum error with the provided header in the error description

func GetInvalidMpObjectSizeErr added in v1.0.11

func GetInvalidMpObjectSizeErr(val string) APIError

func GetInvalidTrailingChecksumHeaderErr added in v1.0.13

func GetInvalidTrailingChecksumHeaderErr(header string) APIError

func GetMultipleWildcardCORSOriginErr added in v1.3.0

func GetMultipleWildcardCORSOriginErr(origin string) APIError

func GetNegatvieMpObjectSizeErr added in v1.0.17

func GetNegatvieMpObjectSizeErr(val int64) APIError

func GetUnsopportedCORSMethodErr added in v1.0.17

func GetUnsopportedCORSMethodErr(method string) APIError

func (APIError) BaseError added in v1.5.0

func (e APIError) BaseError() APIError

func (APIError) Error

func (A APIError) Error() string

func (APIError) StatusCode added in v1.5.0

func (e APIError) StatusCode() int

func (APIError) XMLBody added in v1.5.0

func (e APIError) XMLBody(requestID, hostID string) []byte

type AccessForbiddenError added in v1.5.0

type AccessForbiddenError struct {
	APIError
	Method       string
	ResourceType ResourceType
}

AccessForbiddenError is returned when a CORS request is not allowed. Produces <Method> and <ResourceType> fields in the XML response.

func GetAccessForbiddenErr added in v1.5.0

func GetAccessForbiddenErr(code ErrorCode, method string, resourceType ResourceType) AccessForbiddenError

func (AccessForbiddenError) Is added in v1.5.0

func (e AccessForbiddenError) Is(target error) bool

func (AccessForbiddenError) XMLBody added in v1.5.0

func (e AccessForbiddenError) XMLBody(requestID, hostID string) []byte

type BadDigestError added in v1.5.0

type BadDigestError struct {
	APIError
	CalculatedDigest string
	ExpectedDigest   string
}

BadDigestError is returned when the Content-MD5 does not match the received data. Produces <CalculatedDigest> and <ExpectedDigest> fields in the XML response.

func GetBadDigestErr added in v1.5.0

func GetBadDigestErr(calculated, expected string) BadDigestError

func (BadDigestError) Is added in v1.5.0

func (e BadDigestError) Is(target error) bool

func (BadDigestError) XMLBody added in v1.5.0

func (e BadDigestError) XMLBody(requestID, hostID string) []byte

type BucketError added in v1.5.0

type BucketError struct {
	APIError
	BucketName string
}

BucketError is returned for errors that include the bucket name. Produces a <BucketName> field in the XML response.

func GetBucketErr added in v1.5.0

func GetBucketErr(code ErrorCode, bucket string) BucketError

GetBucketErr creates a BucketError for the given error code and bucket name. Use for: ErrNoSuchBucketPolicy, ErrOwnershipControlsNotFound, ErrBucketNotEmpty, ErrNoSuchCORSConfiguration, and similar errors that should include the bucket name.

func (BucketError) Is added in v1.5.0

func (e BucketError) Is(target error) bool

func (BucketError) XMLBody added in v1.5.0

func (e BucketError) XMLBody(requestID, hostID string) []byte

type Condition added in v1.5.0

type Condition string
const (
	ConditionIfMatch              Condition = "If-Match"
	ConditionIfNoneMatch          Condition = "If-None-Match"
	ConditionIfUnmodifiedSince    Condition = "If-Unmodified-Since"
	ConditionIfMatchSize          Condition = "If-Match-Size"
	ConditionIfMatchInitiatedTime Condition = "If-Match-Initiated-Time"
	ConditionIfMatchLastModTime   Condition = "If-Match-Last-Mod-Time"
	ConditionPostBucket           Condition = "Bucket POST must be of the enclosure-type multipart/form-data"
)

type ContentSHA256MismatchError added in v1.5.0

type ContentSHA256MismatchError struct {
	APIError
	ClientComputedContentSHA256 string
	S3ComputedContentSHA256     string
}

ContentSHA256MismatchError is returned when the x-amz-content-sha256 header does not match the computed hash of the request payload. Produces <ClientComputedContentSHA256> and <S3ComputedContentSHA256> fields.

func GetContentSHA256MismatchErr added in v1.5.0

func GetContentSHA256MismatchErr(clientHash, s3Hash string) ContentSHA256MismatchError

func (ContentSHA256MismatchError) Is added in v1.5.0

func (e ContentSHA256MismatchError) Is(target error) bool

func (ContentSHA256MismatchError) XMLBody added in v1.5.0

func (e ContentSHA256MismatchError) XMLBody(requestID, hostID string) []byte

type EntityTooLargeError added in v1.5.0

type EntityTooLargeError struct {
	APIError
	ProposedSize   int64
	MaxSizeAllowed int64
}

EntityTooLargeError is returned when the proposed upload exceeds the maximum allowed size. Produces <ProposedSize> and <MaxSizeAllowed> fields in the XML response.

func GetEntityTooLargeErr added in v1.5.0

func GetEntityTooLargeErr(proposedSize, maxSizeAllowed int64) EntityTooLargeError

func (EntityTooLargeError) Is added in v1.5.0

func (e EntityTooLargeError) Is(target error) bool

func (EntityTooLargeError) XMLBody added in v1.5.0

func (e EntityTooLargeError) XMLBody(requestID, hostID string) []byte

type EntityTooSmallError added in v1.5.0

type EntityTooSmallError struct {
	APIError
	ProposedSize   int64
	MinSizeAllowed int64
}

EntityTooSmallError is returned when the proposed upload is smaller than the minimum allowed size. Produces <ProposedSize> and <MinSizeAllowed> fields in the XML response.

func GetEntityTooSmallErr added in v1.5.0

func GetEntityTooSmallErr(proposedSize, minSizeAllowed int64) EntityTooSmallError

func (EntityTooSmallError) Is added in v1.5.0

func (e EntityTooSmallError) Is(target error) bool

func (EntityTooSmallError) XMLBody added in v1.5.0

func (e EntityTooSmallError) XMLBody(requestID, hostID string) []byte

type ErrorCode

type ErrorCode int

ErrorCode type of error status.

const (
	ErrNone ErrorCode = iota
	ErrAccessDenied
	ErrAnonymousRequest
	ErrAnonymousCreateMp
	ErrAnonymousCopyObject
	ErrAnonymousPutBucketOwnership
	ErrAnonymousGetBucketOwnership
	ErrAnonymousResponseHeaders
	ErrMethodNotAllowed
	ErrBucketNotEmpty
	ErrVersionedBucketNotEmpty
	ErrBucketAlreadyExists
	ErrBucketAlreadyOwnedByYou
	ErrNoSuchBucket
	ErrNoSuchKey
	ErrNoSuchUpload
	ErrInvalidBucketName
	ErrInvalidDigest
	ErrBadDigest
	ErrInvalidPart
	ErrInvalidPartNumberRange
	ErrRangeAndPartNumber
	ErrInvalidPartOrder
	ErrInternalError
	ErrNonEmptyRequestBody
	ErrIncompleteBody
	ErrInvalidCopyDest
	ErrInvalidTagKey
	ErrInvalidTagValue
	ErrDuplicateTagKey
	ErrBucketTaggingLimited
	ErrObjectTaggingLimited
	ErrCannotParseHTTPRequest
	ErrMalformedPOSTRequest
	ErrEntityTooSmall
	ErrEntityTooLarge
	ErrMalformedXML
	ErrMalformedCredentialDate
	ErrExpiredPresignRequest
	ErrSignatureDoesNotMatch
	ErrContentSHA256Mismatch
	ErrInvalidSHA256PayloadUsage
	ErrUnsupportedAnonymousSignedStreaming
	ErrMissingContentLength
	ErrContentLengthMismatch
	ErrInvalidAccessKeyID
	ErrRequestNotReadyYet
	ErrMissingDateHeader
	ErrGetUploadsWithKey
	ErrVersionsWithKey
	ErrInvalidRequest
	ErrAuthNotSetup
	ErrNotImplemented
	ErrPreconditionFailed
	ErrInvalidObjectState
	ErrInvalidRange
	ErrInvalidURI
	ErrObjectLockConfigurationNotFound
	ErrNoSuchObjectLockConfiguration
	ErrMissingObjectLockConfiguration
	ErrMissingObjectLockConfigurationNoSpaces
	ErrObjectLockConfigurationNotAllowed
	ErrObjectLocked
	ErrNoSuchBucketPolicy
	ErrBucketTaggingNotFound
	ErrObjectAttributesInvalidHeader
	ErrRequestTimeTooSkewed
	ErrInvalidBucketAclWithObjectOwnership
	ErrBothCannedAndHeaderGrants
	ErrOwnershipControlsNotFound
	ErrAclNotSupported
	ErrMalformedACL
	ErrUnexpectedContent
	ErrMissingSecurityHeader
	ErrKeyTooLong
	ErrNoSuchVersion
	ErrSuspendedVersioningNotAllowed
	ErrMissingRequestBody
	ErrMultipleChecksumHeaders
	ErrChecksumSDKAlgoMismatch
	ErrChecksumRequired
	ErrMissingContentSha256
	ErrInvalidChecksumAlgorithm
	ErrChecksumTypeWithAlgo
	ErrInvalidChecksumHeader
	ErrTrailerHeaderNotSupported
	ErrBadRequest
	ErrNoSuchCORSConfiguration
	ErrCORSForbidden
	ErrMissingCORSOrigin
	ErrCORSIsNotEnabled
	ErrNotModified
	ErrInvalidLocationConstraint
	ErrMalformedTrailer
	ErrInvalidChunkSize
	ErrSlowDown
	ErrMetadataTooLarge
	ErrUnsupportedAuthorizationMechanism

	// Non-AWS errors
	ErrExistingObjectIsDirectory
	ErrObjectParentIsFile
	ErrDirectoryObjectContainsData
	ErrDirectoryNotEmpty
	ErrQuotaExceeded
	ErrVersioningNotConfigured
	ErrACLsDisabled
	ErrNoSpaceLeftOnDevice

	// Admin api errors
	ErrAdminAccessDenied
	ErrAdminUserNotFound
	ErrAdminUserExists
	ErrAdminInvalidUserRole
	ErrAdminMissingUserAcess
	ErrAdminMethodNotSupported
	ErrAdminEmptyBucketOwnerHeader
)

Error codes, see full list at http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html

type ExpiredPresignedURLError added in v1.5.0

type ExpiredPresignedURLError struct {
	APIError
	ServerTime  string
	XAmzExpires int
	Expires     string
}

ExpiredPresignedURLError is returned when the presigned url is expired Produces <ServerTime>, <X-Amz-Expires> and <Expires> fields in the XML response.

func GetExpiredPresignedURLError added in v1.5.0

func GetExpiredPresignedURLError(XAmzExpires int, expires, serverTime string) ExpiredPresignedURLError

func (ExpiredPresignedURLError) Is added in v1.5.0

func (e ExpiredPresignedURLError) Is(target error) bool

func (ExpiredPresignedURLError) XMLBody added in v1.5.0

func (e ExpiredPresignedURLError) XMLBody(requestID, hostID string) []byte

type HeadersNotSignedError added in v1.5.0

type HeadersNotSignedError struct {
	APIError
	HeadersNotSigned string
}

HeadersNotSignedError is returned when signature verification receives required signed headers that were omitted from SignedHeaders.

func GetHeadersNotSignedErr added in v1.5.0

func GetHeadersNotSignedErr(headers []string) HeadersNotSignedError

func (HeadersNotSignedError) Is added in v1.5.0

func (e HeadersNotSignedError) Is(target error) bool

func (HeadersNotSignedError) XMLBody added in v1.5.0

func (e HeadersNotSignedError) XMLBody(requestID, hostID string) []byte

type InvalidAccessKeyIdError added in v1.5.0

type InvalidAccessKeyIdError struct {
	APIError
	AWSAccessKeyId string
}

InvalidAccessKeyIdError is returned when the provided AWS access key ID does not exist. Produces an <AWSAccessKeyId> field in the XML response.

func GetInvalidAccessKeyIdErr added in v1.5.0

func GetInvalidAccessKeyIdErr(accessKeyId string) InvalidAccessKeyIdError

func (InvalidAccessKeyIdError) Is added in v1.5.0

func (e InvalidAccessKeyIdError) Is(target error) bool

func (InvalidAccessKeyIdError) XMLBody added in v1.5.0

func (e InvalidAccessKeyIdError) XMLBody(requestID, hostID string) []byte

type InvalidArgErrorCode added in v1.5.0

type InvalidArgErrorCode int
const (
	InvalidArgMaxBuckets InvalidArgErrorCode = iota
	InvalidArgNegativeMaxKeys
	InvalidArgObjectAttributes
	InvalidArgPartNumber
	InvalidArgCompleteMpPartNumber
	InvalidArgCopySourceRange
	InvalidArgCopySourceBucket
	InvalidArgCopySourceObject
	InvalidArgCopySourceEncoding
	InvalidArgURLEncodedTagging
	InvalidArgAuthHeader
	InvalidArgAuthorizationType
	InvalidArgPOSTFileRequired
	InvalidArgSHA256Payload
	InvalidArgCopySource
	InvalidArgRetainUntilDate
	InvalidArgPastObjectLockRetainDate
	InvalidArgObjectLockRetentionDays
	InvalidArgObjectLockRetentionYears
	InvalidArgMissingObjectLockRetainDate
	InvalidArgMissingObjectLockMode
	InvalidArgLegalHoldStatus
	InvalidArgObjectLockMode
	InvalidArgMetadataDirective
	InvalidArgTaggingDirective
	InvalidArgVersionId
	InvalidArgChecksumPart
	InvalidArgMissingUploadId
	InvalidArgUploadIdMarker
	InvalidArgCannedAcl
	InvalidArgOnlyAws4HmacSha256
	InvalidArgDateHeader
)

type InvalidArgumentError added in v1.5.0

type InvalidArgumentError struct {
	Description   string
	ArgumentName  string
	ArgumentValue string
}

InvalidArgumentError is returned when a request argument is invalid. Produces <ArgumentName> and <ArgumentValue> fields in the XML response.

func GetInvalidArgExceedingRange added in v1.5.0

func GetInvalidArgExceedingRange(size int64) InvalidArgumentError

func GetInvalidArgMaxLimiter added in v1.5.0

func GetInvalidArgMaxLimiter(name, value string) InvalidArgumentError

func GetInvalidArgNegativeMaxLimiter added in v1.5.0

func GetInvalidArgNegativeMaxLimiter(name, value string) InvalidArgumentError

func GetInvalidArgObjectOwnership added in v1.5.0

func GetInvalidArgObjectOwnership(value string) InvalidArgumentError

func GetInvalidArgumentErr added in v1.5.0

func GetInvalidArgumentErr(code InvalidArgErrorCode, value string) InvalidArgumentError

func (InvalidArgumentError) BaseError added in v1.5.0

func (e InvalidArgumentError) BaseError() APIError

func (InvalidArgumentError) Error added in v1.5.0

func (e InvalidArgumentError) Error() string

func (InvalidArgumentError) StatusCode added in v1.5.0

func (e InvalidArgumentError) StatusCode() int

InvalidArgumentError http status code is always 400

func (InvalidArgumentError) XMLBody added in v1.5.0

func (e InvalidArgumentError) XMLBody(requestID, hostID string) []byte

type InvalidChunkSizeError added in v1.5.0

type InvalidChunkSizeError struct {
	APIError
	Chunk        int
	BadChunkSize int64
}

InvalidChunkSizeError is returned when a chunk size in a streaming upload is invalid. Produces <Chunk> and <BadChunkSize> fields in the XML response.

func GetInvalidChunkSizeErr added in v1.5.0

func GetInvalidChunkSizeErr(chunk int, badChunkSize int64) InvalidChunkSizeError

func (InvalidChunkSizeError) Is added in v1.5.0

func (e InvalidChunkSizeError) Is(target error) bool

func (InvalidChunkSizeError) XMLBody added in v1.5.0

func (e InvalidChunkSizeError) XMLBody(requestID, hostID string) []byte

type InvalidDigestError added in v1.5.0

type InvalidDigestError struct {
	APIError
	ContentMD5 string
}

InvalidDigestError is returned when the Content-MD5 header value is invalid. Produces a <Content-MD5> field in the XML response.

func GetInvalidDigestErr added in v1.5.0

func GetInvalidDigestErr(contentMD5 string) InvalidDigestError

func (InvalidDigestError) Is added in v1.5.0

func (e InvalidDigestError) Is(target error) bool

func (InvalidDigestError) XMLBody added in v1.5.0

func (e InvalidDigestError) XMLBody(requestID, hostID string) []byte

type InvalidLocationConstraintError added in v1.5.0

type InvalidLocationConstraintError struct {
	APIError
	LocationConstraint string
}

InvalidLocationConstraintError is returned when an invalid location constraint is provided. Produces a <LocationConstraint> field in the XML response.

func GetInvalidLocationConstraintErr added in v1.5.0

func GetInvalidLocationConstraintErr(constraint string) InvalidLocationConstraintError

func (InvalidLocationConstraintError) Is added in v1.5.0

func (InvalidLocationConstraintError) XMLBody added in v1.5.0

func (e InvalidLocationConstraintError) XMLBody(requestID, hostID string) []byte

type InvalidPartError added in v1.5.0

type InvalidPartError struct {
	APIError
	UploadId   string
	PartNumber int32
	ETag       string
}

InvalidPartError is returned when one or more specified parts cannot be found. Produces <UploadId>, <PartNumber>, and <ETag> fields in the XML response.

func GetInvalidPartErr added in v1.5.0

func GetInvalidPartErr(uploadId string, partNumber int32, etag string) InvalidPartError

func (InvalidPartError) Is added in v1.5.0

func (e InvalidPartError) Is(target error) bool

func (InvalidPartError) XMLBody added in v1.5.0

func (e InvalidPartError) XMLBody(requestID, hostID string) []byte

type InvalidPartNumberRangeError added in v1.5.0

type InvalidPartNumberRangeError struct {
	APIError
	ActualPartCount     int32
	PartNumberRequested int32
}

InvalidPartNumberRangeError is returned when the requested part number exceeds the number of parts available for the object. Produces <ActualPartCount> and <PartNumberRequested> fields in the XML response.

func GetInvalidPartNumberRangeErr added in v1.5.0

func GetInvalidPartNumberRangeErr(actualPartCount, partNumberRequested int32) InvalidPartNumberRangeError

func (InvalidPartNumberRangeError) Is added in v1.5.0

func (e InvalidPartNumberRangeError) Is(target error) bool

func (InvalidPartNumberRangeError) XMLBody added in v1.5.0

func (e InvalidPartNumberRangeError) XMLBody(requestID, hostID string) []byte

type InvalidRangeError added in v1.5.0

type InvalidRangeError struct {
	APIError
	RangeRequested   string
	ActualObjectSize int64
}

InvalidRangeError is returned when the requested byte range cannot be satisfied. Produces <RangeRequested> and <ActualObjectSize> fields in the XML response.

func GetInvalidRangeErr added in v1.5.0

func GetInvalidRangeErr(rangeRequested string, actualObjectSize int64) InvalidRangeError

func (InvalidRangeError) Is added in v1.5.0

func (e InvalidRangeError) Is(target error) bool

func (InvalidRangeError) XMLBody added in v1.5.0

func (e InvalidRangeError) XMLBody(requestID, hostID string) []byte

type InvalidTagError added in v1.5.0

type InvalidTagError struct {
	APIError
	TagKey   string
	TagValue string
}

InvalidTagError is returned when a tag key or value is invalid. Produces <TagKey> and optionally <TagValue> fields in the XML response.

func GetInvalidTagErr added in v1.5.0

func GetInvalidTagErr(code ErrorCode, tagKey, tagValue string) InvalidTagError

GetInvalidTagErr creates an InvalidTagError for the given error code, tag key, and optional tag value. code should be ErrInvalidTagKey or ErrInvalidTagValue.

func (InvalidTagError) Is added in v1.5.0

func (e InvalidTagError) Is(target error) bool

func (InvalidTagError) XMLBody added in v1.5.0

func (e InvalidTagError) XMLBody(requestID, hostID string) []byte

type KeyTooLongError added in v1.5.0

type KeyTooLongError struct {
	APIError
	Size           int64
	MaxSizeAllowed int64
}

KeyTooLongError is returned when the object key exceeds the maximum allowed length. Produces <Size> and <MaxSizeAllowed> fields in the XML response.

func GetKeyTooLongErr added in v1.5.0

func GetKeyTooLongErr(size, maxSizeAllowed int64) KeyTooLongError

func (KeyTooLongError) Is added in v1.5.0

func (e KeyTooLongError) Is(target error) bool

func (KeyTooLongError) XMLBody added in v1.5.0

func (e KeyTooLongError) XMLBody(requestID, hostID string) []byte

type MalformedAuthError added in v1.5.0

type MalformedAuthError struct {
	APIError
	Region string
}

MalformedAuthError is returned when a Signature V4 authorization header is malformed. Produces a <Region> field in the XML response when the expected gateway region is known.

func (MalformedAuthError) Is added in v1.5.0

func (e MalformedAuthError) Is(target error) bool

func (MalformedAuthError) XMLBody added in v1.5.0

func (e MalformedAuthError) XMLBody(requestID, hostID string) []byte

type MetadataTooLargeError added in v1.5.0

type MetadataTooLargeError struct {
	APIError
	Size           int
	MaxSizeAllowed int
}

MetadataTooLargeError is returned when the request metadata headers exceed the allowed size. Produces <Size> and <MaxSizeAllowed> fields in the XML response.

func GetMetadataTooLargeErr added in v1.5.0

func GetMetadataTooLargeErr(size, maxSizeAllowed int) MetadataTooLargeError

func (MetadataTooLargeError) Is added in v1.5.0

func (e MetadataTooLargeError) Is(target error) bool

func (MetadataTooLargeError) XMLBody added in v1.5.0

func (e MetadataTooLargeError) XMLBody(requestID, hostID string) []byte

type MethodNotAllowedError added in v1.5.0

type MethodNotAllowedError struct {
	APIError
	Method         string
	ResourceType   ResourceType
	AllowedMethods []string
}

MethodNotAllowedError is returned when an HTTP method is not permitted on a resource. Produces <Method> and <ResourceType> fields in the XML response. AllowedMethods is used to populate the HTTP Allow: response header.

func GetMethodNotAllowedErr added in v1.5.0

func GetMethodNotAllowedErr(method string, resourceType ResourceType, allowed []string) MethodNotAllowedError

func (*MethodNotAllowedError) AllowedMethodsString added in v1.5.0

func (mna *MethodNotAllowedError) AllowedMethodsString() string

func (MethodNotAllowedError) Is added in v1.5.0

func (e MethodNotAllowedError) Is(target error) bool

func (MethodNotAllowedError) XMLBody added in v1.5.0

func (e MethodNotAllowedError) XMLBody(requestID, hostID string) []byte

type NmpAdditionalMessage added in v1.5.0

type NmpAdditionalMessage string
const (
	NmpAdditionalMessageIfNoneMatch         NmpAdditionalMessage = "We don\\'t accept the provided value of If-None-Match header for this API"
	NmpAdditionalMessageMultipleCondHeaders NmpAdditionalMessage = "Multiple conditional request headers present in the request"
)

type NoSuchUploadError added in v1.5.0

type NoSuchUploadError struct {
	APIError
	UploadId string
}

NoSuchUploadError is returned when the specified multipart upload does not exist. Produces an <UploadId> field in the XML response.

func GetNoSuchUploadErr added in v1.5.0

func GetNoSuchUploadErr(uploadId string) NoSuchUploadError

func (NoSuchUploadError) Is added in v1.5.0

func (e NoSuchUploadError) Is(target error) bool

func (NoSuchUploadError) XMLBody added in v1.5.0

func (e NoSuchUploadError) XMLBody(requestID, hostID string) []byte

type NoSuchVersionError added in v1.5.0

type NoSuchVersionError struct {
	APIError
	Key       string
	VersionId string
}

NoSuchVersionError is returned when the specified version does not exist. Produces <Key> and <VersionId> fields in the XML response.

func GetNoSuchVersionErr added in v1.5.0

func GetNoSuchVersionErr(key, versionId string) NoSuchVersionError

func (NoSuchVersionError) Is added in v1.5.0

func (e NoSuchVersionError) Is(target error) bool

func (NoSuchVersionError) XMLBody added in v1.5.0

func (e NoSuchVersionError) XMLBody(requestID, hostID string) []byte

type NotImplementedError added in v1.5.0

type NotImplementedError struct {
	APIError
	Header            string
	AdditionalMessage NmpAdditionalMessage
}

NotImplementedError is returned when a header implies unsupported functionality. Produces <Header> and <additionalMessage> fields in the XML response.

func GetNotImplementedErr added in v1.5.0

func GetNotImplementedErr(header string, additionalMessage NmpAdditionalMessage) NotImplementedError

func (NotImplementedError) Is added in v1.5.0

func (e NotImplementedError) Is(target error) bool

func (NotImplementedError) XMLBody added in v1.5.0

func (e NotImplementedError) XMLBody(requestID, hostID string) []byte

type PreconditionFailedError added in v1.5.0

type PreconditionFailedError struct {
	APIError
	Condition Condition
}

PreconditionFailedError is returned when a conditional request precondition is not met. Produces a <Condition> field in the XML response.

func GetPreconditionFailedErr added in v1.5.0

func GetPreconditionFailedErr(condition Condition) PreconditionFailedError

func (PreconditionFailedError) Is added in v1.5.0

func (e PreconditionFailedError) Is(target error) bool

func (PreconditionFailedError) XMLBody added in v1.5.0

func (e PreconditionFailedError) XMLBody(requestID, hostID string) []byte

type RequestTimeTooSkewedError added in v1.5.0

type RequestTimeTooSkewedError struct {
	APIError
	RequestTime                string
	ServerTime                 string
	MaxAllowedSkewMilliseconds int
}

RequestTimeTooSkewedError is returned when the request timestamp is too far from server time. Produces <RequestTime>, <ServerTime>, and <MaxAllowedSkewMilliseconds> fields.

func GetRequestTimeTooSkewedErr added in v1.5.0

func GetRequestTimeTooSkewedErr(requestTime, serverTime string, maxAllowedMilliseconds int) RequestTimeTooSkewedError

func (RequestTimeTooSkewedError) Is added in v1.5.0

func (e RequestTimeTooSkewedError) Is(target error) bool

func (RequestTimeTooSkewedError) XMLBody added in v1.5.0

func (e RequestTimeTooSkewedError) XMLBody(requestID, hostID string) []byte

type ResourceType added in v1.5.0

type ResourceType string
const (
	ResourceTypeBucket       ResourceType = "BUCKET"
	ResourceTypeObject       ResourceType = "OBJECT"
	ResourceTypeService      ResourceType = "SERVICE"
	ResourceTypeBucketPolicy ResourceType = "BUCKETPOLICY"
	ResourceTypeUpload       ResourceType = "UPLOAD"
)

type S3Error added in v1.5.0

type S3Error interface {
	error
	StatusCode() int
	BaseError() APIError
	XMLBody(requestID, hostID string) []byte
}

S3Error is the interface implemented by all S3 error types. It allows centralized error handling while supporting per-error-type XML fields.

type SignatureDoesNotMatchError added in v1.5.0

type SignatureDoesNotMatchError struct {
	APIError
	AWSAccessKeyId        string
	StringToSign          string
	SignatureProvided     string
	StringToSignBytes     string
	CanonicalRequest      string
	CanonicalRequestBytes string
}

SignatureDoesNotMatchError is returned when request signature verification fails. Produces diagnostic fields to help callers debug the mismatch.

func GetSignatureDoesNotMatchErr added in v1.5.0

func GetSignatureDoesNotMatchErr(accessKeyId, stringToSign, signatureProvided, stringToSignBytes, canonicalRequest, canonicalRequestBytes string) SignatureDoesNotMatchError

func (SignatureDoesNotMatchError) Is added in v1.5.0

func (e SignatureDoesNotMatchError) Is(target error) bool

func (SignatureDoesNotMatchError) XMLBody added in v1.5.0

func (e SignatureDoesNotMatchError) XMLBody(requestID, hostID string) []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL