customizations

package
v1.22.4 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: 8 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

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

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

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

func (*DefaultAccountID) HandleInitialize added in v0.30.0

HandleInitialize implements the InitializeMiddleware interface

func (*DefaultAccountID) ID added in v0.30.0

func (*DefaultAccountID) ID() string

ID returns the id of the middleware

type GlacierAPIVersion added in v0.30.0

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

GlacierAPIVersion handles automatically setting Glacier's API version header.

func (*GlacierAPIVersion) HandleSerialize added in v0.30.0

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

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

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

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

func (*TreeHash) ID() string

ID returns the middleware ID.

Jump to

Keyboard shortcuts

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