MCPcopy
hub / github.com/julienschmidt/httprouter / HandlerFunc

Method HandlerFunc

router.go:282–284  ·  view source on GitHub ↗

HandlerFunc is an adapter which allows the usage of an http.HandlerFunc as a request handle.

(method, path string, handler http.HandlerFunc)

Source from the content-addressed store, hash-verified

280// HandlerFunc is an adapter which allows the usage of an http.HandlerFunc as a
281// request handle.
282func (r *Router) HandlerFunc(method, path string, handler http.HandlerFunc) {
283 r.Handler(method, path, handler)
284}
285
286// ServeFiles serves files from the given file system root.
287// The path must end with "/*filepath", files are then served from the local

Callers 5

TestRouterAPIFunction · 0.80
TestRouterOPTIONSFunction · 0.80
TestRouterNotAllowedFunction · 0.80
TestRouterNotFoundFunction · 0.80

Calls 1

HandlerMethod · 0.95

Tested by 5

TestRouterAPIFunction · 0.64
TestRouterOPTIONSFunction · 0.64
TestRouterNotAllowedFunction · 0.64
TestRouterNotFoundFunction · 0.64