MCPcopy
hub / github.com/labstack/echo / Reverse

Method Reverse

route.go:117–124  ·  view source on GitHub ↗

Reverse reverses route to URL string by replacing path parameters with given params values.

(routeName string, pathValues ...any)

Source from the content-addressed store, hash-verified

115
116// Reverse reverses route to URL string by replacing path parameters with given params values.
117func (r Routes) Reverse(routeName string, pathValues ...any) (string, error) {
118 for _, rr := range r {
119 if rr.Name == routeName {
120 return rr.Reverse(pathValues...), nil
121 }
122 }
123 return "", errors.New("route not found")
124}
125
126// FindByMethodPath searched for matching route info by method and path
127func (r Routes) FindByMethodPath(method string, path string) (RouteInfo, error) {

Calls

no outgoing calls

Tested by 4

TestRoutes_ReverseFunction · 0.36