Documentation
¶
Index ¶
- func AddMetadataRetrieverMiddleware(stack *middleware.Stack) error
- func AddResponseErrorMiddleware(stack *middleware.Stack) error
- func GetARNResourceFromContext(ctx context.Context) (arn.ARN, bool)
- func GetHostIDMetadata(metadata middleware.Metadata) (string, bool)
- func IsClonedInput(ctx context.Context) bool
- func IsFIPS(region string) booldeprecated
- func SetClonedInputKey(ctx context.Context, value bool) context.Context
- func SetHostIDMetadata(metadata *middleware.Metadata, id string)
- type ARNLookup
- type ConfigurationError
- func NewClientConfiguredForAccelerateError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
- func NewClientConfiguredForCrossRegionFIPSError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
- func NewClientConfiguredForDualStackError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
- func NewClientConfiguredForFIPSError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
- func NewClientPartitionMismatchError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
- func NewClientRegionMismatchError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
- func NewFIPSConfigurationError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
- func NewFailedToResolveEndpointError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
- type EnableDualstackdeprecated
- type ErrorComponents
- type ErrorResponseDeserializerOptions
- type InvalidARNError
- type ResourceRequest
- type ResponseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMetadataRetrieverMiddleware ¶
func AddMetadataRetrieverMiddleware(stack *middleware.Stack) error
AddMetadataRetrieverMiddleware adds request id, host id retriever middleware
func AddResponseErrorMiddleware ¶
func AddResponseErrorMiddleware(stack *middleware.Stack) error
AddResponseErrorMiddleware adds response error wrapper middleware
func GetARNResourceFromContext ¶
GetARNResourceFromContext returns an ARN from context and a bool indicating presence of ARN on ctx.
Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues to clear all stack values.
func GetHostIDMetadata ¶
func GetHostIDMetadata(metadata middleware.Metadata) (string, bool)
GetHostIDMetadata retrieves the host id from middleware metadata returns host id as string along with a boolean indicating presence of hostId on middleware metadata.
func IsClonedInput ¶
IsClonedInput retrieves if context key for cloned input was set. If set, we can infer that the reuqest input was cloned previously.
Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues to clear all stack values.
func SetClonedInputKey ¶
SetClonedInputKey sets a key on context to denote input was cloned previously.
Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues to clear all stack values.
func SetHostIDMetadata ¶
func SetHostIDMetadata(metadata *middleware.Metadata, id string)
SetHostIDMetadata sets the provided host id over middleware metadata
Types ¶
type ARNLookup ¶
type ARNLookup struct { // GetARNValue takes in a input interface and returns a ptr to string and a bool GetARNValue func(interface{}) (*string, bool) }
ARNLookup is the initial middleware that looks up if an arn is provided. This middleware is responsible for fetching ARN from a arnable field, and registering the ARN on middleware context. This middleware must be executed before input validation step or any other arn processing middleware.
func (*ARNLookup) HandleInitialize ¶
func (m *ARNLookup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, )
HandleInitialize handles the behavior of this initialize step
type ConfigurationError ¶
type ConfigurationError struct {
// contains filtered or unexported fields
}
ConfigurationError is used to denote a client configuration error
func NewClientConfiguredForAccelerateError ¶
func NewClientConfiguredForAccelerateError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
NewClientConfiguredForAccelerateError denotes client config error for unsupported S3 accelerate
func NewClientConfiguredForCrossRegionFIPSError ¶
func NewClientConfiguredForCrossRegionFIPSError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
NewClientConfiguredForCrossRegionFIPSError denotes client config error for unsupported cross region FIPS request
func NewClientConfiguredForDualStackError ¶
func NewClientConfiguredForDualStackError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
NewClientConfiguredForDualStackError denotes client config error for unsupported S3 Dual-stack
func NewClientConfiguredForFIPSError ¶
func NewClientConfiguredForFIPSError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
NewClientConfiguredForFIPSError denotes client config error for unsupported cross region FIPS access
func NewClientPartitionMismatchError ¶
func NewClientPartitionMismatchError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
NewClientPartitionMismatchError stub
func NewClientRegionMismatchError ¶
func NewClientRegionMismatchError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
NewClientRegionMismatchError denotes cross region access error
func NewFIPSConfigurationError ¶
func NewFIPSConfigurationError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
NewFIPSConfigurationError denotes a configuration error when a client or request is configured for FIPS
func NewFailedToResolveEndpointError ¶
func NewFailedToResolveEndpointError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
NewFailedToResolveEndpointError denotes endpoint resolving error
func (ConfigurationError) Error ¶
func (e ConfigurationError) Error() string
Error returns the Configuration error string
func (ConfigurationError) Unwrap ¶
func (e ConfigurationError) Unwrap() error
OrigErr is the original error wrapped by Configuration Error
type EnableDualstack
deprecated
type EnableDualstack struct { // UseDualstack indicates if dualstack endpoint resolving is to be enabled UseDualstack bool // DefaultServiceID is the service id prefix used in endpoint resolving // by default service-id is 's3' and 's3-control' for service s3, s3control. DefaultServiceID string }
EnableDualstack represents middleware struct for enabling dualstack support
Deprecated: See EndpointResolverOptions' UseDualStackEndpoint support
func (*EnableDualstack) HandleSerialize ¶
func (u *EnableDualstack) HandleSerialize( ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, ) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, )
HandleSerialize handles serializer middleware behavior when middleware is executed
type ErrorComponents ¶
type ErrorComponents struct { Code string `xml:"Code"` Message string `xml:"Message"` RequestID string `xml:"RequestId"` HostID string `xml:"HostId"` }
ErrorComponents represents the error response fields that will be deserialized from an xml error response body
func GetErrorResponseComponents ¶
func GetErrorResponseComponents(r io.Reader, options ErrorResponseDeserializerOptions) (ErrorComponents, error)
GetErrorResponseComponents retrieves error components according to passed in options
func GetUnwrappedErrorResponseComponents ¶
func GetUnwrappedErrorResponseComponents(r io.Reader) (ErrorComponents, error)
GetUnwrappedErrorResponseComponents returns the error fields from an xml error response body
func GetWrappedErrorResponseComponents ¶
func GetWrappedErrorResponseComponents(r io.Reader) (ErrorComponents, error)
GetWrappedErrorResponseComponents returns the error fields from an xml error response body in which error code, and message are wrapped by a <Error> tag
type ErrorResponseDeserializerOptions ¶
type ErrorResponseDeserializerOptions struct { // UseStatusCode denotes if status code should be used to retrieve error code, msg UseStatusCode bool // StatusCode is status code of error response StatusCode int //IsWrappedWithErrorTag represents if error response's code, msg is wrapped within an // additional <Error> tag IsWrappedWithErrorTag bool }
ErrorResponseDeserializerOptions represents error response deserializer options for s3 and s3-control service
type InvalidARNError ¶
type InvalidARNError struct {
// contains filtered or unexported fields
}
InvalidARNError denotes the error for Invalid ARN
func NewInvalidARNError ¶
func NewInvalidARNError(resource arn.Resource, err error) InvalidARNError
NewInvalidARNError denotes invalid arn error
func NewInvalidARNWithFIPSError
deprecated
func NewInvalidARNWithFIPSError(resource arn.Resource, err error) InvalidARNError
NewInvalidARNWithFIPSError ARN not supported for FIPS region
Deprecated: FIPS will not appear in the ARN region component.
func NewInvalidARNWithUnsupportedPartitionError ¶
func NewInvalidARNWithUnsupportedPartitionError(resource arn.Resource, err error) InvalidARNError
NewInvalidARNWithUnsupportedPartitionError ARN not supported for the target partition
func (InvalidARNError) Error ¶
func (e InvalidARNError) Error() string
Error returns the InvalidARN error string
func (InvalidARNError) Unwrap ¶
func (e InvalidARNError) Unwrap() error
OrigErr is the original error wrapped by Invalid ARN Error
type ResourceRequest ¶
type ResourceRequest struct { Resource arn.Resource // RequestRegion is the region configured on the request config RequestRegion string // SigningRegion is the signing region resolved for the request SigningRegion string // PartitionID is the resolved partition id for the provided request region PartitionID string // UseARNRegion indicates if client should use the region provided in an ARN resource UseARNRegion bool // UseFIPS indicates if te client is configured for FIPS UseFIPS bool }
ResourceRequest represents an ARN resource and api request metadata
func (ResourceRequest) AllowCrossRegion ¶
func (r ResourceRequest) AllowCrossRegion() bool
AllowCrossRegion returns a bool value to denote if S3UseARNRegion flag is set
func (ResourceRequest) IsCrossPartition ¶
func (r ResourceRequest) IsCrossPartition() (bool, error)
IsCrossPartition returns true if request is configured for region of another partition, than the partition that resource ARN region resolves to. IsCrossPartition will not return an error, if request is not configured with a specific partition id. This might happen if customer provides custom endpoint url, but does not associate a partition id with it.
func (ResourceRequest) IsCrossRegion ¶
func (r ResourceRequest) IsCrossRegion() bool
IsCrossRegion returns true if request signing region is not same as arn region
func (ResourceRequest) ResourceConfiguredForFIPS
deprecated
func (r ResourceRequest) ResourceConfiguredForFIPS() bool
ResourceConfiguredForFIPS returns true if resource ARNs region is FIPS
Deprecated: FIPS will not be present in the ARN region
type ResponseError ¶
type ResponseError struct { *awshttp.ResponseError // HostID associated with response error HostID string }
ResponseError provides the HTTP centric error type wrapping the underlying error with the HTTP response value and the deserialized RequestID.
func (*ResponseError) As ¶
func (e *ResponseError) As(target interface{}) bool
As populates target and returns true if the type of target is a error type that the ResponseError embeds, (e.g.S3 HTTP ResponseError)
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string
Error returns the formatted error
func (*ResponseError) ServiceHostID ¶
func (e *ResponseError) ServiceHostID() string
ServiceHostID returns the host id associated with Response Error