MCPcopy Index your code
hub / github.com/labstack/echo / ToRouteInfo

Method ToRouteInfo

route.go:25–37  ·  view source on GitHub ↗

ToRouteInfo converts Route to RouteInfo

(params []string)

Source from the content-addressed store, hash-verified

23
24// ToRouteInfo converts Route to RouteInfo
25func (r Route) ToRouteInfo(params []string) RouteInfo {
26 name := r.Name
27 if name == "" {
28 name = r.Method + ":" + r.Path
29 }
30
31 return RouteInfo{
32 Method: r.Method,
33 Path: r.Path,
34 Parameters: append([]string(nil), params...),
35 Name: name,
36 }
37}
38
39// WithPrefix recreates Route with added group prefix and group middlewares it is grouped to.
40func (r Route) WithPrefix(pathPrefix string, middlewares []MiddlewareFunc) Route {

Callers 2

AddMethod · 0.80
TestRoute_ToRouteInfoFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestRoute_ToRouteInfoFunction · 0.64