Use appends a MiddlewareFunc to the chain. Middleware can be used to intercept or otherwise modify requests and/or responses, and are executed in the order that they are applied to the Router.
(mwf ...MiddlewareFunc)
| 22 | |
| 23 | // Use appends a MiddlewareFunc to the chain. Middleware can be used to intercept or otherwise modify requests and/or responses, and are executed in the order that they are applied to the Router. |
| 24 | func (r *Router) Use(mwf ...MiddlewareFunc) { |
| 25 | for _, fn := range mwf { |
| 26 | r.middlewares = append(r.middlewares, fn) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | // useInterface appends a middleware to the chain. Middleware can be used to intercept or otherwise modify requests and/or responses, and are executed in the order that they are applied to the Router. |
| 31 | func (r *Router) useInterface(mw middleware) { |
no outgoing calls