Documentation
¶
Index ¶
- type Handle
- type Param
- type Params
- type Router
- func (router *Router) Handle(method string, path string, handle Handle)
- func (router *Router) NotFound(handle http.HandlerFunc)
- func (router *Router) Panic(handle func(http.ResponseWriter, *http.Request, interface{}))
- func (router *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (router *Router) Validates(validates Validates)
- type Validate
- type Validates
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handle ¶
type Handle func(w http.ResponseWriter, r *http.Request, params Params)
Handle is a function that can be registered to a route to handle HTTP requests.
type Params ¶ added in v0.7.1
type Params []Param
Params is a Param-slice, as returned by the router. The slice is ordered, the first URL parameter is also the first slice value. It is therefore safe to read values by the index.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is a http.Handler which can be used to dispatch requests to different handler functions.
func (*Router) NotFound ¶
func (router *Router) NotFound(handle http.HandlerFunc)
NotFound sets a NotFound handle.
func (*Router) Panic ¶ added in v0.7.1
func (router *Router) Panic(handle func(http.ResponseWriter, *http.Request, interface{}))
Panic sets a panic handle.
Click to show internal directories.
Click to hide internal directories.