Documentation ¶
Overview ¶
Package middlewares contains all registered router middlewares.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, mid Middleware) error
Register registers provided middleware within the container
Types ¶
type Chain ¶
type Chain []Middleware
Chain is the middleware executable chain.
func (Chain) Handle ¶
func (c Chain) Handle(handle httprouter.Handle) httprouter.Handle
Handle handles the chain of middlewares for given 'handle' httprouter.Handle.
type Middleware ¶
type Middleware func(next httprouter.Handle) httprouter.Handle
Middleware is the standard http library middleware function.
func Get ¶
func Get(name string) (Middleware, error)
Get returns the middleware function by it's name If the middleware with provided name doesn't exists returns an error
Click to show internal directories.
Click to hide internal directories.