package customizations

import "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"

Package customizations provides customizations for the Amazon S3 API client.

This package provides support for following S3 customizations

UpdateEndpoint Middleware: Virtual Host style url addressing

processResponseWith200Error Middleware: Deserializing response error with 200 status code

Virtual Host style url addressing

Since serializers serialize by default as path style url, we use customization to modify the endpoint url when `UsePathStyle` option on S3Client is unset or false.

UpdateEndpoint middleware handler for virtual host url addressing needs to be executed after request serialization.

Middleware layering:

HTTP Request -> operation serializer -> Update-Endpoint customization -> next middleware

Customization option:

UsePathStyle (Disabled by Default)

Handle Error response with 200 status code

S3 operations: CopyObject, CompleteMultipartUpload, UploadPartCopy can have an error Response with status code 2xx. The processResponseWith200Error middleware customizations enables SDK to check for an error within response body prior to deserialization.

As the check for 2xx response containing an error needs to be performed earlier than response deserialization. Since the behavior of Deserialization is in reverse order to the other stack steps its easier to consider that "after" means "before".

    Middleware layering:

	HTTP Response -> handle 200 error customization -> deserialize

Index

Functions

func HandleResponseErrorWith200Status

func HandleResponseErrorWith200Status(stack *middleware.Stack)

HandleResponseErrorWith200Status check for S3 200 error response. If an s3 200 error is found, status code for the response is modified temporarily to 5xx response status code.

func UpdateEndpoint

func UpdateEndpoint(stack *middleware.Stack, options UpdateEndpointOptions)

UpdateEndpoint adds the middleware to the middleware stack based on the UpdateEndpointOptions.

Types

type UpdateEndpointOptions

type UpdateEndpointOptions struct {
	// functional pointer to fetch bucket name from provided input.
	// The function is intended to take an input value, and
	// return a string pointer to value of string, and bool if
	// input has no bucket member.
	GetBucketFromInput func(interface{}) (*string, bool)

	// use path style
	UsePathStyle bool
}

UpdateEndpointOptions provides the options for the UpdateEndpoint middleware setup.

Source Files

doc.go handle_200_error.go update_endpoint.go

Version
v0.27.0
Published
Oct 17, 2020
Platform
linux/amd64
Imports
12 packages
Last checked
now

Tools for package owners.