Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Route ¶ added in v0.9.2
Route returns the handle registered with the given path (key). The values of wildcard values are set on the context via UnderlyingSetPathParam.
If no handle can be found, a TSR (trailing slash redirect) recommendation is made if a handle exists with an extra (without the) trailing slash for the given path.
Types ¶
type Node ¶
type Node[H any] struct { // contains filtered or unexported fields }
Node is a node in the radix tree.
func (*Node[H]) AddRoute ¶
AddRoute adds a node with the given handle to the path. Not concurrency-safe!
func (*Node[H]) FindCaseInsensitivePath ¶
func (n *Node[H]) FindCaseInsensitivePath(path string, fixTrailingSlash bool) (fixedPath string, found bool)
FindCaseInsensitivePath makes a case-insensitive lookup of the given path to find a route with a registered handle.
It can optionally also fix trailing slashes.
It returns the case-corrected path and a bool indicating whether the lookup was successful.