s3shared

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMetadataRetrieverMiddleware

func AddMetadataRetrieverMiddleware(stack *middleware.Stack)

AddMetadataRetrieverMiddleware adds request id, host id retriever middleware

func AddResponseErrorMiddleware

func AddResponseErrorMiddleware(stack *middleware.Stack)

AddResponseErrorMiddleware adds response error wrapper middleware

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 SetHostIDMetadata

func SetHostIDMetadata(metadata *middleware.Metadata, id string)

SetHostIDMetadata sets the provided host id over middleware metadata

Types

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) (ErrorComponents, error)

GetErrorResponseComponents returns the error fields from an xml error response body

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

Jump to

Keyboard shortcuts

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