Documentation
¶
Overview ¶
Package router provides URL path matching and building utilities. It supports path parameters (e.g., :id) and wildcard matching (*).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPath ¶
BuildPath substitutes parameter placeholders in a pattern with values from params. Example: BuildPath("/users/:id", map[string]string{"id": "42"}) returns "/users/42"
func FunctionPath ¶
FunctionPath builds a full path for a function with the given pattern and parameters. Returns "/fn/{functionID}{path}"
func FunctionURL ¶
FunctionURL builds a full URL for a function with the given pattern and parameters. Returns "{baseURL}/fn/{functionID}{path}"
Types ¶
type MatchResult ¶
MatchResult contains the result of a path match operation.
func Match ¶
func Match(path, pattern string) MatchResult
Match checks if a path matches a pattern and returns match result with extracted parameters. Pattern syntax:
- :name captures a path segment into params["name"]
- * at the end matches any remaining path segments