s3shared

package module
v1.17.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add100Continue added in v1.14.0

func Add100Continue(stack *middleware.Stack, continueHeaderThresholdBytes int64) error

Add100Continue add middleware, which adds {Expect: 100-continue} header for s3 client HTTP PUT request larger than 2MB or with unknown size streaming bodies, during operation builder step

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 added in v0.3.2

func GetARNResourceFromContext(ctx context.Context) (arn.ARN, bool)

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 added in v0.3.2

func IsClonedInput(ctx context.Context) bool

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 deprecated added in v0.3.2

func IsFIPS(region string) bool

IsFIPS returns true if region is a fips pseudo-region

Deprecated: FIPS should be specified via EndpointOptions.

func SetClonedInputKey added in v0.3.2

func SetClonedInputKey(ctx context.Context, value bool) context.Context

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 added in v0.3.2

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 added in v0.3.2

HandleInitialize handles the behavior of this initialize step

func (*ARNLookup) ID added in v0.3.2

func (m *ARNLookup) ID() string

ID for the middleware

type ConfigurationError added in v0.3.2

type ConfigurationError struct {
	// contains filtered or unexported fields
}

ConfigurationError is used to denote a client configuration error

func NewClientConfiguredForAccelerateError added in v0.3.2

func NewClientConfiguredForAccelerateError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError

NewClientConfiguredForAccelerateError denotes client config error for unsupported S3 accelerate

func NewClientConfiguredForCrossRegionFIPSError added in v0.3.2

func NewClientConfiguredForCrossRegionFIPSError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError

NewClientConfiguredForCrossRegionFIPSError denotes client config error for unsupported cross region FIPS request

func NewClientConfiguredForDualStackError added in v0.3.2

func NewClientConfiguredForDualStackError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError

NewClientConfiguredForDualStackError denotes client config error for unsupported S3 Dual-stack

func NewClientConfiguredForFIPSError added in v0.3.2

func NewClientConfiguredForFIPSError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError

NewClientConfiguredForFIPSError denotes client config error for unsupported cross region FIPS access

func NewClientPartitionMismatchError added in v0.3.2

func NewClientPartitionMismatchError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError

NewClientPartitionMismatchError stub

func NewClientRegionMismatchError added in v0.3.2

func NewClientRegionMismatchError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError

NewClientRegionMismatchError denotes cross region access error

func NewFIPSConfigurationError added in v1.4.0

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 added in v0.3.2

func NewFailedToResolveEndpointError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError

NewFailedToResolveEndpointError denotes endpoint resolving error

func (ConfigurationError) Error added in v0.3.2

func (e ConfigurationError) Error() string

Error returns the Configuration error string

func (ConfigurationError) Unwrap added in v0.3.2

func (e ConfigurationError) Unwrap() error

OrigErr is the original error wrapped by Configuration Error

type EnableDualstack deprecated added in v0.3.2

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 added in v0.3.2

HandleSerialize handles serializer middleware behavior when middleware is executed

func (*EnableDualstack) ID added in v0.3.2

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 added in v0.3.2

func GetUnwrappedErrorResponseComponents(r io.Reader) (ErrorComponents, error)

GetUnwrappedErrorResponseComponents returns the error fields from an xml error response body

func GetWrappedErrorResponseComponents added in v0.3.2

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 added in v0.3.2

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 added in v0.3.2

type InvalidARNError struct {
	// contains filtered or unexported fields
}

InvalidARNError denotes the error for Invalid ARN

func NewInvalidARNError added in v0.3.2

func NewInvalidARNError(resource arn.Resource, err error) InvalidARNError

NewInvalidARNError denotes invalid arn error

func NewInvalidARNWithFIPSError deprecated added in v0.3.2

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 added in v0.3.2

func NewInvalidARNWithUnsupportedPartitionError(resource arn.Resource, err error) InvalidARNError

NewInvalidARNWithUnsupportedPartitionError ARN not supported for the target partition

func (InvalidARNError) Error added in v0.3.2

func (e InvalidARNError) Error() string

Error returns the InvalidARN error string

func (InvalidARNError) Unwrap added in v0.3.2

func (e InvalidARNError) Unwrap() error

OrigErr is the original error wrapped by Invalid ARN Error

type ResourceRequest added in v0.3.2

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) ARN added in v0.3.2

func (r ResourceRequest) ARN() awsarn.ARN

ARN returns the resource ARN

func (ResourceRequest) AllowCrossRegion added in v0.3.2

func (r ResourceRequest) AllowCrossRegion() bool

AllowCrossRegion returns a bool value to denote if S3UseARNRegion flag is set

func (ResourceRequest) IsCrossPartition added in v0.3.2

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 added in v0.3.2

func (r ResourceRequest) IsCrossRegion() bool

IsCrossRegion returns true if request signing region is not same as arn region

func (ResourceRequest) ResourceConfiguredForFIPS deprecated added in v0.3.2

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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