Documentation ¶
Overview ¶
Package router combines routing and middleware handling in a single package.
Index ¶
- type Item
- func (s *Item) Chain(c ...alice.Constructor) []alice.Constructor
- func (s *Item) ChainHandler(h http.Handler, c ...alice.Constructor) http.Handler
- func (s *Item) Delete(path string, fn http.HandlerFunc, c ...alice.Constructor)
- func (s *Item) Get(path string, fn http.HandlerFunc, c ...alice.Constructor)
- func (s *Item) Param(r *http.Request, name string) string
- func (s *Item) Patch(path string, fn http.HandlerFunc, c ...alice.Constructor)
- func (s *Item) Post(path string, fn http.HandlerFunc, c ...alice.Constructor)
- func (s *Item) Put(path string, fn http.HandlerFunc, c ...alice.Constructor)
- func (s *Item) RouteList() []string
- func (s *Item) Router() *vestigo.Router
- func (s *Item) SetMethodNotAllowed(fn vestigo.MethodNotAllowedHandlerFunc)
- func (s *Item) SetNotFound(fn http.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item implements the password hashing system.
func (*Item) Chain ¶
func (s *Item) Chain(c ...alice.Constructor) []alice.Constructor
Chain returns an array of middleware.
func (*Item) ChainHandler ¶
ChainHandler returns a handler of chained middleware.
func (*Item) Delete ¶
func (s *Item) Delete(path string, fn http.HandlerFunc, c ...alice.Constructor)
Delete is a shortcut for router.Handle("DELETE", path, handle).
func (*Item) Get ¶
func (s *Item) Get(path string, fn http.HandlerFunc, c ...alice.Constructor)
Get is a shortcut for router.Handle("GET", path, handle).
func (*Item) Patch ¶
func (s *Item) Patch(path string, fn http.HandlerFunc, c ...alice.Constructor)
Patch is a shortcut for router.Handle("PATCH", path, handle).
func (*Item) Post ¶
func (s *Item) Post(path string, fn http.HandlerFunc, c ...alice.Constructor)
Post is a shortcut for router.Handle("POST", path, handle).
func (*Item) Put ¶
func (s *Item) Put(path string, fn http.HandlerFunc, c ...alice.Constructor)
Put is a shortcut for router.Handle("PUT", path, handle).
func (*Item) SetMethodNotAllowed ¶
func (s *Item) SetMethodNotAllowed(fn vestigo.MethodNotAllowedHandlerFunc)
SetMethodNotAllowed sets the 405 handler.
func (*Item) SetNotFound ¶
func (s *Item) SetNotFound(fn http.HandlerFunc)
SetNotFound sets the 404 handler.
Click to show internal directories.
Click to hide internal directories.