chore: upgrade dependencies

This commit is contained in:
2022-06-09 12:30:53 +02:00
parent 7203f3d6a1
commit dcb93ec8f7
518 changed files with 27809 additions and 3222 deletions

View File

@@ -1,4 +1,4 @@
// Package middleware provide transport agnostic middleware for decorating SDK
// Package middleware provides transport agnostic middleware for decorating SDK
// handlers.
//
// The Smithy middleware stack provides ordered behavior to be invoked on an
@@ -24,7 +24,7 @@
// order by the Stack. These steps represent fixed points in the middleware stack
// for organizing specific behavior, such as serialize and build. A Stack Step is
// composed of zero or more middleware that are specific to that step. A step may
// define its on set of input/output parameters the generic input/output
// define its own set of input/output parameters the generic input/output
// parameters are cast from. A step calls its middleware recursively, before
// calling the next step in the stack returning the result or error of the step
// middleware decorating the underlying handler.
@@ -39,7 +39,7 @@
// HTTP's Content-Length header, or body checksum). Decorations and
// modifications to the message should be copied to all message attempts.
//
// * Finalize: Preforms final preparations needed before sending the message. The
// * Finalize: Performs final preparations needed before sending the message. The
// message should already be complete by this stage, and is only alternated to
// meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request
// signing).
@@ -51,8 +51,8 @@
// Adding Middleware to a Stack Step
//
// Middleware can be added to a step front or back, or relative, by name, to an
// existing middleware in that stack. If a middleware does not have a name a
// unique name will be generated at the middleware is added to the step.
// existing middleware in that stack. If a middleware does not have a name, a
// unique name will be generated at the middleware and be added to the step.
//
// // Create middleware stack
// stack := middleware.NewStack()

View File

@@ -42,7 +42,7 @@ func (m Metadata) Clone() Metadata {
// that key it will be replaced with the new value.
//
// Set method must be called as an addressable value, or pointer. If Set is not
// called as a addressable value or pointer, the key value pair being set may
// called as an addressable value or pointer, the key value pair being set may
// be lost.
//
// Panics if the key type is not comparable.
@@ -53,7 +53,7 @@ func (m *Metadata) Set(key, value interface{}) {
m.values[key] = value
}
// Has returns if the key exists in the metadata.
// Has returns whether the key exists in the metadata.
//
// Panics if the key type is not comparable.
func (m Metadata) Has(key interface{}) bool {

View File

@@ -48,7 +48,7 @@ func (g *orderedIDs) Add(m ider, pos RelativePosition) error {
return nil
}
// Insert injects the item relative to an existing item id. Return error if
// Insert injects the item relative to an existing item id. Returns an error if
// the original item does not exist, or the item being added already exists.
func (g *orderedIDs) Insert(m ider, relativeTo string, pos RelativePosition) error {
if len(m.ID()) == 0 {
@@ -66,13 +66,13 @@ func (g *orderedIDs) Insert(m ider, relativeTo string, pos RelativePosition) err
return nil
}
// Get returns the ider identified by id. If ider is not present, returns false
// Get returns the ider identified by id. If ider is not present, returns false.
func (g *orderedIDs) Get(id string) (ider, bool) {
v, ok := g.items[id]
return v, ok
}
// Swap removes the item by id, replacing it with the new item. Returns error
// Swap removes the item by id, replacing it with the new item. Returns an error
// if the original item doesn't exist.
func (g *orderedIDs) Swap(id string, m ider) (ider, error) {
if len(id) == 0 {
@@ -96,7 +96,7 @@ func (g *orderedIDs) Swap(id string, m ider) (ider, error) {
return removed, nil
}
// Remove removes the item by id. Returns error if the item
// Remove removes the item by id. Returns an error if the item
// doesn't exist.
func (g *orderedIDs) Remove(id string) (ider, error) {
if len(id) == 0 {
@@ -147,7 +147,7 @@ func newRelativeOrder() *relativeOrder {
}
}
// Add inserts a item into the order relative to the position provided.
// Add inserts an item into the order relative to the position provided.
func (s *relativeOrder) Add(pos RelativePosition, ids ...string) error {
if len(ids) == 0 {
return nil
@@ -173,7 +173,7 @@ func (s *relativeOrder) Add(pos RelativePosition, ids ...string) error {
return nil
}
// Insert injects a item before or after the relative item. Returns
// Insert injects an item before or after the relative item. Returns
// an error if the relative item does not exist.
func (s *relativeOrder) Insert(relativeTo string, pos RelativePosition, ids ...string) error {
if len(ids) == 0 {
@@ -195,7 +195,7 @@ func (s *relativeOrder) Insert(relativeTo string, pos RelativePosition, ids ...s
}
// Swap will replace the item id with the to item. Returns an
// error if the original item id does not exist. Allows swapping out a
// error if the original item id does not exist. Allows swapping out an
// item for another item with the same id.
func (s *relativeOrder) Swap(id, to string) error {
i, ok := s.has(id)

View File

@@ -7,7 +7,7 @@ import (
)
// Stack provides protocol and transport agnostic set of middleware split into
// distinct steps. Steps have specific transitions between them, that is
// distinct steps. Steps have specific transitions between them, that are
// managed by the individual step.
//
// Steps are composed as middleware around the underlying handler in the
@@ -15,7 +15,7 @@ import (
//
// Initialize -> Serialize -> Build -> Finalize -> Deserialize -> Handler
//
// Any middleware within the chain may chose to stop and return an error or
// Any middleware within the chain may choose to stop and return an error or
// response. Since the middleware decorate the handler like a call stack, each
// middleware will receive the result of the next middleware in the chain.
// Middleware that does not need to react to an input, or result must forward
@@ -23,7 +23,7 @@ import (
//
// Initialize <- Serialize -> Build -> Finalize <- Deserialize <- Handler
type Stack struct {
// Initialize Prepares the input, and sets any default parameters as
// Initialize prepares the input, and sets any default parameters as
// needed, (e.g. idempotency token, and presigned URLs).
//
// Takes Input Parameters, and returns result or error.
@@ -31,7 +31,7 @@ type Stack struct {
// Receives result or error from Serialize step.
Initialize *InitializeStep
// Serializes the prepared input into a data structure that can be consumed
// Serialize serializes the prepared input into a data structure that can be consumed
// by the target transport's message, (e.g. REST-JSON serialization)
//
// Converts Input Parameters into a Request, and returns the result or error.
@@ -39,7 +39,7 @@ type Stack struct {
// Receives result or error from Build step.
Serialize *SerializeStep
// Adds additional metadata to the serialized transport message,
// Build adds additional metadata to the serialized transport message
// (e.g. HTTP's Content-Length header, or body checksum). Decorations and
// modifications to the message should be copied to all message attempts.
//
@@ -48,9 +48,9 @@ type Stack struct {
// Receives result or error from Finalize step.
Build *BuildStep
// Preforms final preparations needed before sending the message. The
// Finalize performs final preparations needed before sending the message. The
// message should already be complete by this stage, and is only alternated
// to meet the expectations of the recipient, (e.g. Retry and AWS SigV4
// to meet the expectations of the recipient (e.g. Retry and AWS SigV4
// request signing)
//
// Takes Request, and returns result or error.
@@ -58,7 +58,7 @@ type Stack struct {
// Receives result or error from Deserialize step.
Finalize *FinalizeStep
// Reacts to the handler's response returned by the recipient of the request
// Deserialize reacts to the handler's response returned by the recipient of the request
// message. Deserializes the response into a structured type or error above
// stacks can react to.
//

View File

@@ -6,7 +6,7 @@ import (
"strings"
)
// WithStackValue adds a key value pair to the context that are intended to be
// WithStackValue adds a key value pair to the context that is intended to be
// scoped to a stack. Use ClearStackValues to get a new context with all stack
// values cleared.
func WithStackValue(ctx context.Context, key, value interface{}) context.Context {

View File

@@ -70,12 +70,12 @@ func (s buildMiddlewareFunc) HandleBuild(ctx context.Context, in BuildInput, nex
var _ BuildMiddleware = (buildMiddlewareFunc{})
// BuildStep provides the ordered grouping of BuildMiddleware to be invoked on
// an handler.
// a handler.
type BuildStep struct {
ids *orderedIDs
}
// NewBuildStep returns an BuildStep ready to have middleware for
// NewBuildStep returns a BuildStep ready to have middleware for
// initialization added to it.
func NewBuildStep() *BuildStep {
return &BuildStep{
@@ -131,14 +131,14 @@ func (s *BuildStep) Add(m BuildMiddleware, pos RelativePosition) error {
}
// Insert injects the middleware relative to an existing middleware id.
// Return error if the original middleware does not exist, or the middleware
// Returns an error if the original middleware does not exist, or the middleware
// being added already exists.
func (s *BuildStep) Insert(m BuildMiddleware, relativeTo string, pos RelativePosition) error {
return s.ids.Insert(m, relativeTo, pos)
}
// Swap removes the middleware by id, replacing it with the new middleware.
// Returns the middleware removed, or error if the middleware to be removed
// Returns the middleware removed, or an error if the middleware to be removed
// doesn't exist.
func (s *BuildStep) Swap(id string, m BuildMiddleware) (BuildMiddleware, error) {
removed, err := s.ids.Swap(id, m)

View File

@@ -12,7 +12,7 @@ type DeserializeInput struct {
}
// DeserializeOutput provides the result returned by the next
// DeserializeHandler. The DeserializeMiddleware should deserailize the
// DeserializeHandler. The DeserializeMiddleware should deserialize the
// RawResponse into a Result that can be consumed by middleware higher up in
// the stack.
type DeserializeOutput struct {
@@ -32,11 +32,11 @@ type DeserializeHandler interface {
// serialize step. Delegates to the next DeserializeHandler for further
// processing.
type DeserializeMiddleware interface {
// Unique ID for the middleware in the DeserializeStep. The step does not
// ID returns a unique ID for the middleware in the DeserializeStep. The step does not
// allow duplicate IDs.
ID() string
// Invokes the middleware behavior which must delegate to the next handler
// HandleDeserialize invokes the middleware behavior which must delegate to the next handler
// for the middleware chain to continue. The method must return a result or
// error to its caller.
HandleDeserialize(ctx context.Context, in DeserializeInput, next DeserializeHandler) (
@@ -76,12 +76,12 @@ func (s deserializeMiddlewareFunc) HandleDeserialize(ctx context.Context, in Des
var _ DeserializeMiddleware = (deserializeMiddlewareFunc{})
// DeserializeStep provides the ordered grouping of DeserializeMiddleware to be
// invoked on an handler.
// invoked on a handler.
type DeserializeStep struct {
ids *orderedIDs
}
// NewDeserializeStep returns an DeserializeStep ready to have middleware for
// NewDeserializeStep returns a DeserializeStep ready to have middleware for
// initialization added to it.
func NewDeserializeStep() *DeserializeStep {
return &DeserializeStep{
@@ -91,7 +91,7 @@ func NewDeserializeStep() *DeserializeStep {
var _ Middleware = (*DeserializeStep)(nil)
// ID returns the unique id of the step as a middleware.
// ID returns the unique ID of the step as a middleware.
func (s *DeserializeStep) ID() string {
return "Deserialize stack step"
}
@@ -136,8 +136,8 @@ func (s *DeserializeStep) Add(m DeserializeMiddleware, pos RelativePosition) err
return s.ids.Add(m, pos)
}
// Insert injects the middleware relative to an existing middleware id.
// Return error if the original middleware does not exist, or the middleware
// Insert injects the middleware relative to an existing middleware ID.
// Returns error if the original middleware does not exist, or the middleware
// being added already exists.
func (s *DeserializeStep) Insert(m DeserializeMiddleware, relativeTo string, pos RelativePosition) error {
return s.ids.Insert(m, relativeTo, pos)
@@ -182,7 +182,7 @@ type deserializeWrapHandler struct {
var _ DeserializeHandler = (*deserializeWrapHandler)(nil)
// Implements DeserializeHandler, converts types and delegates to underlying
// HandleDeserialize implements DeserializeHandler, converts types and delegates to underlying
// generic handler.
func (w deserializeWrapHandler) HandleDeserialize(ctx context.Context, in DeserializeInput) (
out DeserializeOutput, metadata Metadata, err error,

View File

@@ -26,11 +26,11 @@ type FinalizeHandler interface {
// serialize step. Delegates to the next FinalizeHandler for further
// processing.
type FinalizeMiddleware interface {
// Unique ID for the middleware in the FinalizeStep. The step does not
// ID returns a unique ID for the middleware in the FinalizeStep. The step does not
// allow duplicate IDs.
ID() string
// Invokes the middleware behavior which must delegate to the next handler
// HandleFinalize invokes the middleware behavior which must delegate to the next handler
// for the middleware chain to continue. The method must return a result or
// error to its caller.
HandleFinalize(ctx context.Context, in FinalizeInput, next FinalizeHandler) (
@@ -70,12 +70,12 @@ func (s finalizeMiddlewareFunc) HandleFinalize(ctx context.Context, in FinalizeI
var _ FinalizeMiddleware = (finalizeMiddlewareFunc{})
// FinalizeStep provides the ordered grouping of FinalizeMiddleware to be
// invoked on an handler.
// invoked on a handler.
type FinalizeStep struct {
ids *orderedIDs
}
// NewFinalizeStep returns an FinalizeStep ready to have middleware for
// NewFinalizeStep returns a FinalizeStep ready to have middleware for
// initialization added to it.
func NewFinalizeStep() *FinalizeStep {
return &FinalizeStep{
@@ -130,8 +130,8 @@ func (s *FinalizeStep) Add(m FinalizeMiddleware, pos RelativePosition) error {
return s.ids.Add(m, pos)
}
// Insert injects the middleware relative to an existing middleware id.
// Return error if the original middleware does not exist, or the middleware
// Insert injects the middleware relative to an existing middleware ID.
// Returns error if the original middleware does not exist, or the middleware
// being added already exists.
func (s *FinalizeStep) Insert(m FinalizeMiddleware, relativeTo string, pos RelativePosition) error {
return s.ids.Insert(m, relativeTo, pos)
@@ -176,7 +176,7 @@ type finalizeWrapHandler struct {
var _ FinalizeHandler = (*finalizeWrapHandler)(nil)
// Implements FinalizeHandler, converts types and delegates to underlying
// HandleFinalize implements FinalizeHandler, converts types and delegates to underlying
// generic handler.
func (w finalizeWrapHandler) HandleFinalize(ctx context.Context, in FinalizeInput) (
out FinalizeOutput, metadata Metadata, err error,

View File

@@ -26,11 +26,11 @@ type InitializeHandler interface {
// initialize step. Delegates to the next InitializeHandler for further
// processing.
type InitializeMiddleware interface {
// Unique ID for the middleware in the InitializeStep. The step does not
// ID returns a unique ID for the middleware in the InitializeStep. The step does not
// allow duplicate IDs.
ID() string
// Invokes the middleware behavior which must delegate to the next handler
// HandleInitialize invokes the middleware behavior which must delegate to the next handler
// for the middleware chain to continue. The method must return a result or
// error to its caller.
HandleInitialize(ctx context.Context, in InitializeInput, next InitializeHandler) (
@@ -70,7 +70,7 @@ func (s initializeMiddlewareFunc) HandleInitialize(ctx context.Context, in Initi
var _ InitializeMiddleware = (initializeMiddlewareFunc{})
// InitializeStep provides the ordered grouping of InitializeMiddleware to be
// invoked on an handler.
// invoked on a handler.
type InitializeStep struct {
ids *orderedIDs
}
@@ -85,7 +85,7 @@ func NewInitializeStep() *InitializeStep {
var _ Middleware = (*InitializeStep)(nil)
// ID returns the unique id of the step as a middleware.
// ID returns the unique ID of the step as a middleware.
func (s *InitializeStep) ID() string {
return "Initialize stack step"
}
@@ -130,8 +130,8 @@ func (s *InitializeStep) Add(m InitializeMiddleware, pos RelativePosition) error
return s.ids.Add(m, pos)
}
// Insert injects the middleware relative to an existing middleware id.
// Return error if the original middleware does not exist, or the middleware
// Insert injects the middleware relative to an existing middleware ID.
// Returns error if the original middleware does not exist, or the middleware
// being added already exists.
func (s *InitializeStep) Insert(m InitializeMiddleware, relativeTo string, pos RelativePosition) error {
return s.ids.Insert(m, relativeTo, pos)
@@ -176,7 +176,7 @@ type initializeWrapHandler struct {
var _ InitializeHandler = (*initializeWrapHandler)(nil)
// Implements InitializeHandler, converts types and delegates to underlying
// HandleInitialize implements InitializeHandler, converts types and delegates to underlying
// generic handler.
func (w initializeWrapHandler) HandleInitialize(ctx context.Context, in InitializeInput) (
out InitializeOutput, metadata Metadata, err error,

View File

@@ -29,11 +29,11 @@ type SerializeHandler interface {
// serialize step. Delegates to the next SerializeHandler for further
// processing.
type SerializeMiddleware interface {
// Unique ID for the middleware in the SerializeStep. The step does not
// ID returns a unique ID for the middleware in the SerializeStep. The step does not
// allow duplicate IDs.
ID() string
// Invokes the middleware behavior which must delegate to the next handler
// HandleSerialize invokes the middleware behavior which must delegate to the next handler
// for the middleware chain to continue. The method must return a result or
// error to its caller.
HandleSerialize(ctx context.Context, in SerializeInput, next SerializeHandler) (
@@ -73,13 +73,13 @@ func (s serializeMiddlewareFunc) HandleSerialize(ctx context.Context, in Seriali
var _ SerializeMiddleware = (serializeMiddlewareFunc{})
// SerializeStep provides the ordered grouping of SerializeMiddleware to be
// invoked on an handler.
// invoked on a handler.
type SerializeStep struct {
newRequest func() interface{}
ids *orderedIDs
}
// NewSerializeStep returns an SerializeStep ready to have middleware for
// NewSerializeStep returns a SerializeStep ready to have middleware for
// initialization added to it. The newRequest func parameter is used to
// initialize the transport specific request for the stack SerializeStep to
// serialize the input parameters into.
@@ -92,7 +92,7 @@ func NewSerializeStep(newRequest func() interface{}) *SerializeStep {
var _ Middleware = (*SerializeStep)(nil)
// ID returns the unique id of the step as a middleware.
// ID returns the unique ID of the step as a middleware.
func (s *SerializeStep) ID() string {
return "Serialize stack step"
}
@@ -138,8 +138,8 @@ func (s *SerializeStep) Add(m SerializeMiddleware, pos RelativePosition) error {
return s.ids.Add(m, pos)
}
// Insert injects the middleware relative to an existing middleware id.
// Return error if the original middleware does not exist, or the middleware
// Insert injects the middleware relative to an existing middleware ID.
// Returns error if the original middleware does not exist, or the middleware
// being added already exists.
func (s *SerializeStep) Insert(m SerializeMiddleware, relativeTo string, pos RelativePosition) error {
return s.ids.Insert(m, relativeTo, pos)