FromStdWithNext receives a standar handler - middleware form - and returns a compatible context.Handler wrapper.
(h func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc))
| 58 | // FromStdWithNext receives a standar handler - middleware form - and returns a |
| 59 | // compatible context.Handler wrapper. |
| 60 | func FromStdWithNext(h func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)) context.Handler { |
| 61 | return func(ctx *context.Context) { |
| 62 | next := func(w http.ResponseWriter, r *http.Request) { |
| 63 | ctx.ResetRequest(r) |
| 64 | ctx.Next() |
| 65 | } |
| 66 | |
| 67 | h(ctx.ResponseWriter(), ctx.Request(), next) |
| 68 | } |
| 69 | } |
searching dependent graphs…