Documentation ¶
Overview ¶
Package router combines routing and middleware handling in a single package.
Index ¶
- func Chain(c ...alice.Constructor) []alice.Constructor
- func ChainHandler(h http.Handler, c ...alice.Constructor) http.Handler
- func Delete(path string, fn http.HandlerFunc, c ...alice.Constructor)
- func Get(path string, fn http.HandlerFunc, c ...alice.Constructor)
- func Instance() *vestigo.Router
- func MethodNotAllowed(fn vestigo.MethodNotAllowedHandlerFunc)
- func NotFound(fn http.HandlerFunc)
- func Param(r *http.Request, name string) string
- func Patch(path string, fn http.HandlerFunc, c ...alice.Constructor)
- func Post(path string, fn http.HandlerFunc, c ...alice.Constructor)
- func Put(path string, fn http.HandlerFunc, c ...alice.Constructor)
- func ResetConfig()
- func RouteList() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chain ¶
func Chain(c ...alice.Constructor) []alice.Constructor
Chain returns an array of middleware.
func ChainHandler ¶
ChainHandler returns a handler of chained middleware.
func Delete ¶
func Delete(path string, fn http.HandlerFunc, c ...alice.Constructor)
Delete is a shortcut for router.Handle("DELETE", path, handle).
func Get ¶
func Get(path string, fn http.HandlerFunc, c ...alice.Constructor)
Get is a shortcut for router.Handle("GET", path, handle).
func MethodNotAllowed ¶
func MethodNotAllowed(fn vestigo.MethodNotAllowedHandlerFunc)
MethodNotAllowed sets the 405 handler.
func Patch ¶
func Patch(path string, fn http.HandlerFunc, c ...alice.Constructor)
Patch is a shortcut for router.Handle("PATCH", path, handle).
func Post ¶
func Post(path string, fn http.HandlerFunc, c ...alice.Constructor)
Post is a shortcut for router.Handle("POST", path, handle).
func Put ¶
func Put(path string, fn http.HandlerFunc, c ...alice.Constructor)
Put is a shortcut for router.Handle("PUT", path, handle).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.