Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RoutePattern ¶
RoutePattern represents a compiled route pattern with parameters
func ParseRoutePattern ¶
func ParseRoutePattern(pattern string) (*RoutePattern, error)
ParseRoutePattern converts a route template into a regex pattern and parameter names Supported formats:
- /users/{id}
- /files/{name}/raw
- /posts/{year:\d{4}}/{slug:[^/]+}
- /api/{version}/users/{id:\d+}/profile
- /static/{*:.*} (wildcard parameter for "at the end")
Everything outside of {…} is safely regex-escaped Trailing slash is ignored at compile-time; both /path and /path/ are accepted at match-time Wildcard parameters (*) can match any characters including slashes
Click to show internal directories.
Click to hide internal directories.