customizations

package
v0.26.0 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: 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)

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

func AddGlacierAPIVersionMiddleware

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

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

func AddTreeHashMiddleware

func AddTreeHashMiddleware(stack *middleware.Stack)

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

Types

type DefaultAccountIDMiddleware

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

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

func (*DefaultAccountIDMiddleware) HandleInitialize

HandleInitialize implements the InitializeMiddleware interface

func (*DefaultAccountIDMiddleware) ID

ID returns the id of the middleware

type GlacierAPIVersionMiddleware

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

GlacierAPIVersionMiddleware handles automatically setting Glacier's API version header.

func (*GlacierAPIVersionMiddleware) HandleSerialize

HandleSerialize implements the SerializeMiddleware interface

func (*GlacierAPIVersionMiddleware) ID

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 TreeHashMiddleware

type TreeHashMiddleware struct{}

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

func (*TreeHashMiddleware) HandleFinalize

HandleFinalize implements the finalize middleware handler method

func (*TreeHashMiddleware) ID

func (*TreeHashMiddleware) 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