clair/vendor/github.com/julienschmidt/httprouter/params_legacy.go
Sida Chen 4106322107 vendor: Update gopkg.in/yaml.v2 package
* Update gopkg.in/yaml.v2 package and glide setting
* Update other packages
2018-10-22 23:00:58 -04:00

17 lines
428 B
Go

// +build !go1.7
package httprouter
import "net/http"
// Handler is an adapter which allows the usage of an http.Handler as a
// request handle. With go 1.7+, the Params will be available in the
// request context under ParamsKey.
func (r *Router) Handler(method, path string, handler http.Handler) {
r.Handle(method, path,
func(w http.ResponseWriter, req *http.Request, _ Params) {
handler.ServeHTTP(w, req)
},
)
}