Routes returns a slice of registered routes, including some useful information, such as: the http method, path, and the handler name.
()
| 388 | // Routes returns a slice of registered routes, including some useful information, such as: |
| 389 | // the http method, path, and the handler name. |
| 390 | func (engine *Engine) Routes() (routes RoutesInfo) { |
| 391 | for _, tree := range engine.trees { |
| 392 | routes = iterate("", tree.method, routes, tree.root) |
| 393 | } |
| 394 | return routes |
| 395 | } |
| 396 | |
| 397 | func iterate(path, method string, routes RoutesInfo, root *node) RoutesInfo { |
| 398 | path += root.path |