Documentation
¶
Index ¶
- type Handle
- type Param
- type Params
- type Router
- func (router *Router) Handle(method string, path string, handle Handle)
- func (router *Router) HandleOptions(handle func(http.ResponseWriter, *http.Request))
- func (router *Router) HandlePanic(handle func(http.ResponseWriter, *http.Request, interface{}))
- func (router *Router) NotFound(handle http.HandlerFunc)
- 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) HandleOptions ¶ added in v0.7.6
func (router *Router) HandleOptions(handle func(http.ResponseWriter, *http.Request))
HandleOptions sets a options handle.
func (*Router) HandlePanic ¶ added in v0.7.6
func (router *Router) HandlePanic(handle func(http.ResponseWriter, *http.Request, interface{}))
HandlePanic sets a panic handle.
func (*Router) NotFound ¶
func (router *Router) NotFound(handle http.HandlerFunc)
NotFound sets a NotFound handle.
Click to show internal directories.
Click to hide internal directories.