HandlerFunc builds and returns a http.Handler from the chain of middlewares, with `h http.Handler` as the final handler.
(h http.HandlerFunc)
| 16 | // HandlerFunc builds and returns a http.Handler from the chain of middlewares, |
| 17 | // with `h http.Handler` as the final handler. |
| 18 | func (mws Middlewares) HandlerFunc(h http.HandlerFunc) http.Handler { |
| 19 | return &ChainHandler{h, chain(mws, h), mws} |
| 20 | } |
| 21 | |
| 22 | // ChainHandler is a http.Handler with support for handler composition and |
| 23 | // execution. |