package customizations

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

Package customizations provides customizations for the Glacier API client.

Computing tree hash and sha256 checksum

Glacier requires not only a sha256 checksum header, but also a tree hash. These can be set as inputs to the relevant commands, but in most cases this would just be tedious boilerplate. So if the checksums have not been provided, the client will automatically calculate them.

Index

Functions

func AddDefaultAccountIDMiddleware

func AddDefaultAccountIDMiddleware(stack *middleware.Stack, setDefaultAccountID setDefaultAccountID) error

AddDefaultAccountIDMiddleware adds the DefaultAccountID to the stack using the given options.

func AddGlacierAPIVersionMiddleware

func AddGlacierAPIVersionMiddleware(stack *middleware.Stack, apiVersion string) error

AddGlacierAPIVersionMiddleware explicitly add handling for the Glacier api version middleware to the operation stack.

func AddTreeHashMiddleware

func AddTreeHashMiddleware(stack *middleware.Stack) error

AddTreeHashMiddleware adds middleware needed to automatically calculate Glacier's required checksum headers.

Types

type DefaultAccountID

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

DefaultAccountID sets the account ID to "-" if it isn't already set

func (*DefaultAccountID) HandleInitialize

HandleInitialize implements the InitializeMiddleware interface

func (*DefaultAccountID) ID

func (*DefaultAccountID) ID() string

ID returns the id of the middleware

type GlacierAPIVersion

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

GlacierAPIVersion handles automatically setting Glacier's API version header.

func (*GlacierAPIVersion) HandleSerialize

func (m *GlacierAPIVersion) HandleSerialize(
	ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler,
) (
	output middleware.SerializeOutput, metadata middleware.Metadata, err error,
)

HandleSerialize implements the SerializeMiddleware interface

func (*GlacierAPIVersion) ID

func (*GlacierAPIVersion) ID() string

ID returns the id for the middleware.

type Hash

type Hash struct {
	TreeHash   []byte
	LinearHash []byte
}

Hash contains information about the tree-hash and linear hash of a Glacier payload. This structure is generated by computeHashes().

type TreeHash

type TreeHash struct{}

TreeHash provides the middleware that will automatically set the sha256 and tree hash headers if they have not already been set.

func (*TreeHash) HandleFinalize

func (*TreeHash) HandleFinalize(
	ctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler,
) (
	output middleware.FinalizeOutput, metadata middleware.Metadata, err error,
)

HandleFinalize implements the finalize middleware handler method

func (*TreeHash) ID

func (*TreeHash) ID() string

ID returns the middleware ID.

Source Files

accountid.go apiversion.go doc.go treehash.go

Version
v1.27.3 (latest)
Published
Apr 3, 2025
Platform
js/wasm
Imports
8 packages
Last checked
2 hours ago

Tools for package owners.