Chain creates a middleware that composes all of the internal chained middleware
(middlewares ...Middleware)
| 12 | // Chain creates a middleware that composes all of the internal chained |
| 13 | // middleware |
| 14 | func Chain(middlewares ...Middleware) Middleware { |
| 15 | return func(next http.Handler) http.Handler { |
| 16 | for _, x := range slices.Backward(middlewares) { |
| 17 | next = x(next) |
| 18 | } |
| 19 | return next |
| 20 | } |
| 21 | } |