Documentation
¶
Overview ¶
Package router implements an http router
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher[T any] interface { Add(r *RouteDefinition, t *T) Find(*http.Request) *T All() []Route[T] }
func NewPathMatcher ¶
type PathMatcher ¶
type PathMatcher[T any] struct { // contains filtered or unexported fields }
PathMatcher holds information for routing urls with wildcard
func (*PathMatcher[T]) Add ¶
func (rt *PathMatcher[T]) Add(req *RouteDefinition, t *T)
Add a new route to the table
func (*PathMatcher[T]) All ¶
func (rt *PathMatcher[T]) All() []Route[T]
func (*PathMatcher[T]) Find ¶
func (n *PathMatcher[T]) Find(req *http.Request) *T
func (*PathMatcher[T]) Routes ¶
func (rt *PathMatcher[T]) Routes() []routeInfo[T]
type RouteDefinition ¶
func NewRouteDefinition ¶
func NewRouteDefinition(def string) *RouteDefinition
Click to show internal directories.
Click to hide internal directories.