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

Method FindByMethodPath

route.go:127–138  ·  view source on GitHub ↗

FindByMethodPath searched for matching route info by method and path

(method string, path string)

Source from the content-addressed store, hash-verified

125
126// FindByMethodPath searched for matching route info by method and path
127func (r Routes) FindByMethodPath(method string, path string) (RouteInfo, error) {
128 if r == nil {
129 return RouteInfo{}, errors.New("route not found by method and path")
130 }
131
132 for _, rr := range r {
133 if rr.Method == method && rr.Path == path {
134 return rr, nil
135 }
136 }
137 return RouteInfo{}, errors.New("route not found by method and path")
138}
139
140// FilterByMethod searched for matching route info by method
141func (r Routes) FilterByMethod(method string) (Routes, error) {

Callers 1

Calls

no outgoing calls

Tested by 1