WrapHandler wraps `http.Handler` into `echo.HandlerFunc`.
(h http.Handler)
| 819 | |
| 820 | // WrapHandler wraps `http.Handler` into `echo.HandlerFunc`. |
| 821 | func WrapHandler(h http.Handler) HandlerFunc { |
| 822 | return func(c *Context) error { |
| 823 | req := c.Request() |
| 824 | req.Pattern = c.Path() |
| 825 | for _, p := range c.PathValues() { |
| 826 | req.SetPathValue(p.Name, p.Value) |
| 827 | } |
| 828 | |
| 829 | h.ServeHTTP(c.Response(), req) |
| 830 | return nil |
| 831 | } |
| 832 | } |
| 833 | |
| 834 | // WrapMiddleware wraps `func(http.Handler) http.Handler` into `echo.MiddlewareFunc` |
| 835 | func WrapMiddleware(m func(http.Handler) http.Handler) MiddlewareFunc { |
searching dependent graphs…