MCPcopy
hub / github.com/gorilla/mux / HandleFunc

Method HandleFunc

mux.go:300–303  ·  mux.go::Router.HandleFunc

HandleFunc registers a new route with a matcher for the URL path. See Route.Path() and Route.HandlerFunc().

(path string, f func(http.ResponseWriter,
	*http.Request))

Source from the content-addressed store, hash-verified

298// HandleFunc registers a new route with a matcher for the URL path.
299// See Route.Path() and Route.HandlerFunc().
300func (r *Router) HandleFunc(path string, f func(http.ResponseWriter,
301 *http.Request)) *Route {
302 return r.NewRoute().Path(path).HandlerFunc(f)
303}
304
305// Headers registers a new route with a matcher for request header values.
306// See Route.Headers().

Callers 15

TestMiddlewareAddFunction · 0.95
TestMiddlewareFunction · 0.95
TestMiddlewareSubrouterFunction · 0.95
TestMiddlewareExecutionFunction · 0.95
TestMiddlewareNotFoundFunction · 0.95
Test301RedirectFunction · 0.95
TestSkipCleanFunction · 0.95
TestSubrouterHeaderFunction · 0.95

Calls 3

NewRouteMethod · 0.95
HandlerFuncMethod · 0.80
PathMethod · 0.45

Tested by 15

TestMiddlewareAddFunction · 0.76
TestMiddlewareFunction · 0.76
TestMiddlewareSubrouterFunction · 0.76
TestMiddlewareExecutionFunction · 0.76
TestMiddlewareNotFoundFunction · 0.76
Test301RedirectFunction · 0.76
TestSkipCleanFunction · 0.76
TestSubrouterHeaderFunction · 0.76