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 ¶
- func AddDefaultAccountIDMiddleware(stack *middleware.Stack, setDefaultAccountID setDefaultAccountID)
- func AddGlacierAPIVersionMiddleware(stack *middleware.Stack, apiVersion string)
- func AddTreeHashMiddleware(stack *middleware.Stack)
- type DefaultAccountIDMiddleware
- type GlacierAPIVersionMiddleware
- type Hash
- type TreeHashMiddleware
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 ¶
func (m *DefaultAccountIDMiddleware) HandleInitialize( ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, ) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, )
HandleInitialize implements the InitializeMiddleware interface
func (*DefaultAccountIDMiddleware) ID ¶
func (*DefaultAccountIDMiddleware) ID() string
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 ¶
func (m *GlacierAPIVersionMiddleware) HandleSerialize( ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler, ) ( output middleware.SerializeOutput, metadata middleware.Metadata, err error, )
HandleSerialize implements the SerializeMiddleware interface
func (*GlacierAPIVersionMiddleware) ID ¶
func (*GlacierAPIVersionMiddleware) ID() string
ID returns the id for the middleware.
type Hash ¶
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 ¶
func (*TreeHashMiddleware) 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 (*TreeHashMiddleware) ID ¶
func (*TreeHashMiddleware) ID() string
ID returns the middleware ID.