package s3shared
import "github.com/aws/aws-sdk-go-v2/service/internal/s3shared"
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(clientRegion string) bool
- func SetClonedInputKey(ctx context.Context, value bool) context.Context
- func SetHostIDMetadata(metadata *middleware.Metadata, id string)
- type ARNLookup
- func (m *ARNLookup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, )
- func (m *ARNLookup) ID() string
- 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 NewFailedToResolveEndpointError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError
- func (e ConfigurationError) Error() string
- func (e ConfigurationError) Unwrap() error
- type EnableDualstack
- func (u *EnableDualstack) HandleSerialize( ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, ) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, )
- func (*EnableDualstack) ID() string
- type ErrorComponents
- func GetErrorResponseComponents(r io.Reader, options ErrorResponseDeserializerOptions) (ErrorComponents, error)
- func GetUnwrappedErrorResponseComponents(r io.Reader) (ErrorComponents, error)
- func GetWrappedErrorResponseComponents(r io.Reader) (ErrorComponents, error)
- type ErrorResponseDeserializerOptions
- type InvalidARNError
- func NewInvalidARNError(resource arn.Resource, err error) InvalidARNError
- func NewInvalidARNWithFIPSError(resource arn.Resource, err error) InvalidARNError
- func NewInvalidARNWithUnsupportedPartitionError(resource arn.Resource, err error) InvalidARNError
- func (e InvalidARNError) Error() string
- func (e InvalidARNError) Unwrap() error
- type ResourceRequest
- func (r ResourceRequest) ARN() awsarn.ARN
- func (r ResourceRequest) AllowCrossRegion() bool
- func (r ResourceRequest) IsCrossPartition() (bool, error)
- func (r ResourceRequest) IsCrossRegion() bool
- func (r ResourceRequest) ResourceConfiguredForFIPS() bool
- func (r ResourceRequest) UseFips() bool
- type ResponseError
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 IsFIPS ¶
IsFIPS returns true if region is a fips region
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
func (*ARNLookup) ID ¶
ID for the middleware
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 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 ¶
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
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
func (*EnableDualstack) ID ¶
func (*EnableDualstack) ID() string
ID returns the middleware ID.
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 ¶
func NewInvalidARNWithFIPSError(resource arn.Resource, err error) InvalidARNError
NewInvalidARNWithFIPSError ARN not supported for FIPS region
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 }
ResourceRequest represents an ARN resource and api request metadata
func (ResourceRequest) ARN ¶
func (r ResourceRequest) ARN() awsarn.ARN
ARN returns the resource ARN
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.
func (ResourceRequest) IsCrossRegion ¶
func (r ResourceRequest) IsCrossRegion() bool
IsCrossRegion returns true if request signing region is not same as arn region
func (ResourceRequest) ResourceConfiguredForFIPS ¶
func (r ResourceRequest) ResourceConfiguredForFIPS() bool
ResourceConfiguredForFIPS returns true if resource ARNs region is FIPS
func (ResourceRequest) UseFips ¶
func (r ResourceRequest) UseFips() bool
UseFips returns true if request config region is FIPS 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
Source Files ¶
arn_lookup.go endpoint_error.go host_id.go metadata.go metadata_retriever.go resource_request.go response_error.go response_error_middleware.go update_endpoint.go xml_utils.go
Directories ¶
Path | Synopsis |
---|---|
arn | |
config |
- Version
- v1.0.0
- Published
- Jan 19, 2021
- Platform
- js/wasm
- Imports
- 13 packages
- Last checked
- now –
Tools for package owners.