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

Method NewRoute

mux.go:279–284  ·  mux.go::Router.NewRoute

---------------------------------------------------------------------------- Route factories ---------------------------------------------------------------------------- NewRoute registers an empty route.

()

Source from the content-addressed store, hash-verified

277
278// NewRoute registers an empty route.
279func (r *Router) NewRoute() *Route {
280 // initialize a route with a copy of the parent router's configuration
281 route := &Route{routeConf: copyRouteConf(r.routeConf), namedRoutes: r.namedRoutes}
282 r.routes = append(r.routes, route)
283 return route
284}
285
286// Name registers a new route with a name.
287// See Route.Name().

Callers 15

NameMethod · 0.95
HandleMethod · 0.95
HandleFuncMethod · 0.95
HeadersMethod · 0.95
HostMethod · 0.95
MatcherFuncMethod · 0.95
MethodsMethod · 0.95
PathMethod · 0.95
PathPrefixMethod · 0.95
QueriesMethod · 0.95
SchemesMethod · 0.95
BuildVarsFuncMethod · 0.95

Calls 1

copyRouteConfFunction · 0.85

Tested by 11

TestNamedRoutesFunction · 0.76
TestNameMultipleCallsFunction · 0.76
TestStrictSlashFunction · 0.76
TestUseEncodedPathFunction · 0.76
TestRouteMatchersFunction · 0.76
TestMatchedRouteNameFunction · 0.76
TestSubRoutingFunction · 0.76
TestRedirectSlashFunction · 0.76