Пример #1
0
func wrapper(chain alice.Chain, f Route) http.Handler {
	return chain.ThenFunc(func(w http.ResponseWriter, r *http.Request) {
		f(r.Context(), w, r)
	})
}
Пример #2
0
// HTTPHandler wraps a raw http.Handler in chain middleware.
func HTTPHandler(c alice.Chain, fs http.Handler) http.Handler {
	return c.Then(fs)
}