router

package
v1.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRouteNotFound = errors.New("route not found")

ErrRouteNotFound is returned when no route matches the path and no default backend is configured.

Functions

func MatchPath

func MatchPath(routes []route.Route, path string) (*route.Route, error)

MatchPath returns the first route in the slice (config order) whose path rule matches the request path. For prefix routes, the first match wins; order matters in configuration.

func RouteForPath

func RouteForPath(cfg *config.Config, path string) (*route.Route, error)

RouteForPath returns the service route for a request path, using the first matching route, or the default backend from cfg when no route matches and default backend is configured.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL