RemoveRouteByName is used to remove a route from the stack by name. If no methods are specified, it will remove the route for all methods defined in the app. You should call RebuildTree after using this to ensure consistency of the tree.
(name string, methods ...string)
| 552 | // If no methods are specified, it will remove the route for all methods defined in the app. |
| 553 | // You should call RebuildTree after using this to ensure consistency of the tree. |
| 554 | func (app *App) RemoveRouteByName(name string, methods ...string) { |
| 555 | matchFunc := func(r *Route) bool { return r.Name == name } |
| 556 | app.deleteRoute(methods, matchFunc) |
| 557 | } |
| 558 | |
| 559 | // RemoveRouteFunc is used to remove a route from the stack by a custom match function. |
| 560 | // If no methods are specified, it will remove the route for all methods defined in the app. |