Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handlers ¶
func Handlers(handlers ...ChainedHandler) http.Handler
Handlers is a variadic function that will describe the order of contextual handlers and returns a standard http.Handler to be used for the request.
Types ¶
type ChainLinkFunc ¶
ChainLinkFunc is a simple func that represents a ChainedHandler
func (ChainLinkFunc) ChainLink ¶
func (chain ChainLinkFunc) ChainLink(inner Handler) Handler
ChainLink is the implementation of ChainedHandler for the ChainLinkFunc
type ChainedHandler ¶
ChainedHandler represents a contextual chain handler that requires each handler to wrap the rest of the chain
func Last ¶
func Last(handler Handler) ChainedHandler
Last is intended for the last handler in the chain that will not require wrapping the next handler.
type Handler ¶
Handler is similar to http.Handler but with the added context.Context parameter that can be used to share data between layers of an API
type HandlerFunc ¶
HandlerFunc is a simple func to represent a contextual handler
func (HandlerFunc) ServeHTTP ¶
func (c HandlerFunc) ServeHTTP(ctx context.Context, rw http.ResponseWriter, r *http.Request)
ServeHTTP is the HandlerFunc implementation of the contextual.Handler interface