Documentation ¶
Overview ¶
Package router contains a flexible router, with integrated context management per request
Index ¶
- type Route
- type Router
- func (r *Router) Delete(path string, handler http.Handler) *Route
- func (r *Router) DeleteFunc(path string, handler http.HandlerFunc) *Route
- func (r *Router) Get(path string, handler http.Handler) *Route
- func (r *Router) GetFunc(path string, handler http.HandlerFunc) *Route
- func (r *Router) HandleFunc(method string, path string, handler http.HandlerFunc) *Route
- func (r *Router) Handler(method string, path string, handler http.Handler) *Route
- func (r *Router) Options(path string, handler http.Handler) *Route
- func (r *Router) OptionsFunc(path string, handler http.HandlerFunc) *Route
- func (r *Router) Patch(path string, handler http.Handler) *Route
- func (r *Router) PatchFunc(path string, handler http.HandlerFunc) *Route
- func (r *Router) Post(path string, handler http.Handler) *Route
- func (r *Router) PostFunc(path string, handler http.HandlerFunc) *Route
- func (r *Router) Put(path string, handler http.Handler) *Route
- func (r *Router) PutFunc(path string, handler http.HandlerFunc) *Route
- func (r *Router) RouteFor(name string, args ...string) string
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route represents a Router matching rule, to be further refined.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router register routes to be matched and dispatches its corresponding handler. As the router accepts path arguments then it fills the context with the them.
func (*Router) Delete ¶
Delete register the handler in the router, after wrapping it with the middleware
func (*Router) DeleteFunc ¶
func (r *Router) DeleteFunc(path string, handler http.HandlerFunc) *Route
DeleteFunc register the handler in the router, after wrapping it with the middleware
func (*Router) GetFunc ¶
func (r *Router) GetFunc(path string, handler http.HandlerFunc) *Route
GetFunc register the handler in the router, after wrapping it with the middleware
func (*Router) HandleFunc ¶
HandleFunc register a handler to be dispatched when a request matches with the method and the path.
func (*Router) Handler ¶
Handler register a handler to be dispatched when a request matches with the method and the path.
func (*Router) Options ¶
Options register the handler in the router, after wrapping it with the middleware
func (*Router) OptionsFunc ¶
func (r *Router) OptionsFunc(path string, handler http.HandlerFunc) *Route
OptionsFunc register the handler in the router, after wrapping it with the middleware
func (*Router) Patch ¶
Patch register the handler in the router, after wrapping it with the middleware
func (*Router) PatchFunc ¶
func (r *Router) PatchFunc(path string, handler http.HandlerFunc) *Route
PatchFunc register the handler in the router, after wrapping it with the middleware
func (*Router) Post ¶
Post register the handler in the router, after wrapping it with the middleware
func (*Router) PostFunc ¶
func (r *Router) PostFunc(path string, handler http.HandlerFunc) *Route
PostFunc register the handler in the router, after wrapping it with the middleware
func (*Router) PutFunc ¶
func (r *Router) PutFunc(path string, handler http.HandlerFunc) *Route
PutFunc register the handler in the router, after wrapping it with the middleware