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

Method RemoveRouteByName

router.go:554–557  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
554func (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.

Calls 1

deleteRouteMethod · 0.95