(path, method string, routes RoutesInfo, root *node)
| 395 | } |
| 396 | |
| 397 | func iterate(path, method string, routes RoutesInfo, root *node) RoutesInfo { |
| 398 | path += root.path |
| 399 | if len(root.handlers) > 0 { |
| 400 | handlerFunc := root.handlers.Last() |
| 401 | routes = append(routes, RouteInfo{ |
| 402 | Method: method, |
| 403 | Path: path, |
| 404 | Handler: nameOfFunction(handlerFunc), |
| 405 | HandlerFunc: handlerFunc, |
| 406 | }) |
| 407 | } |
| 408 | for _, child := range root.children { |
| 409 | routes = iterate(path, method, routes, child) |
| 410 | } |
| 411 | return routes |
| 412 | } |
| 413 | |
| 414 | func (engine *Engine) prepareTrustedCIDRs() ([]*net.IPNet, error) { |
| 415 | if engine.trustedProxies == nil { |
no test coverage detected