Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain is an immutable sequence of constructors. This type is essentially a bundle of middleware for HTTP clients.
func NewChain ¶
func NewChain(ctors ...Constructor) (c Chain)
NewChain creates a chain from a sequence of constructors. The constructors are always applied in the order presented here.
func (Chain) Append ¶
func (c Chain) Append(more ...Constructor) (nc Chain)
Append adds additional Constructors to this chain, and returns the new chain. This chain is not modified. If more has zero length, this chain is returned.
func (Chain) Extend ¶
Extend is like Append, except that the additional Constructors come from another chain
type Constructor ¶
Constructor applies clientside middleware to an HTTP client, as implemented by httpaux.Client.
func Header ¶ added in v0.1.6
func Header(hf func(http.Header)) Constructor
Header adds a middleware Constructor that uses a closure to modify each request header. Both httpaux.Header.SetTo and httpaux.Header.AddTo can be used as this closure.