Documentation
¶
Overview ¶
Package route provides an enumerable case-insensitive protocol router.
Index ¶
- func Query(values url.Values, name string) []string
- type Route
- type Router
- func (r *Router) Handle(method, pattern string, h http.Handler) error
- func (r *Router) Routes() []Route
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) SetMiddleware(m func(Route, http.Handler) http.Handler)
- func (r *Router) SetUnmatched(observer func(*http.Request, int))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) Handle ¶
Handle registers a literal/parameter route. Parameters use {name}; a final {name...} captures the remaining path. Duplicate patterns are rejected.
func (*Router) SetMiddleware ¶ added in v0.3.4
SetMiddleware wraps each matched route after its path parameters are set.
Click to show internal directories.
Click to hide internal directories.