Documentation ¶
Overview ¶
Package Router, returns instance for express Router Functions defined here are extended by express.go itself
Express Router takes the url regex as similar to the js one Router.Get("/:param") will return the param in Response.Params["param"]
Index ¶
- func CompileRegex(url string) *regexp.Regexp
- type Middleware
- type NextFunc
- type Route
- type Router
- func (r *Router) Delete(url string, middleware Middleware) *Router
- func (r *Router) FindNext(index int, method string, url string, request *request.Request) (Middleware, int, bool)
- func (r *Router) Get(url string, middleware Middleware) *Router
- func (r *Router) Init()
- func (r *Router) Patch(url string, middleware Middleware) *Router
- func (r *Router) Post(url string, middleware Middleware) *Router
- func (r *Router) Put(url string, middleware Middleware) *Router
- func (r *Router) Use(middleware interface{}) *Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileRegex ¶ added in v1.0.2
Helper which returns a golang RegExp for a given express route string
Types ¶
type Middleware ¶
Middleware function singature type
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
A Route contains a regexp and a Router.Middleware type handler
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Collection of all method types routers
Click to show internal directories.
Click to hide internal directories.