MCPcopy
hub / github.com/gofiber/fiber / RemoveRouteFunc

Method RemoveRouteFunc

router.go:563–565  ·  view source on GitHub ↗

RemoveRouteFunc is used to remove a route from the stack by a custom match function. 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. Note: The route.Path is original path, not th

(matchFunc func(r *Route) bool, methods ...string)

Source from the content-addressed store, hash-verified

561// You should call RebuildTree after using this to ensure consistency of the tree.
562// Note: The route.Path is original path, not the normalized path.
563func (app *App) RemoveRouteFunc(matchFunc func(r *Route) bool, methods ...string) {
564 app.deleteRoute(methods, matchFunc)
565}
566
567func (app *App) deleteRoute(methods []string, matchFunc func(r *Route) bool) {
568 if len(methods) == 0 {

Callers 1

TestRemoveRouteFunction · 0.80

Calls 1

deleteRouteMethod · 0.95

Tested by 1

TestRemoveRouteFunction · 0.64