Documentation ¶
Index ¶
- Constants
- type Router
- func (r *Router) AddRoute(method string, pattern string, handler http.HandlerFunc)
- func (r *Router) Del(pattern string, handler http.HandlerFunc)
- func (r *Router) Filter(filter http.HandlerFunc)
- func (r *Router) FilterParam(param string, filter http.HandlerFunc)
- func (r *Router) FilterPath(path string, filter http.HandlerFunc)
- func (r *Router) Get(pattern string, handler http.HandlerFunc)
- func (r *Router) Patch(pattern string, handler http.HandlerFunc)
- func (r *Router) Post(pattern string, handler http.HandlerFunc)
- func (r *Router) Put(pattern string, handler http.HandlerFunc)
- func (r *Router) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (r *Router) Static(pattern string, dir string)
Constants ¶
View Source
const ( DELETE = "DELETE" GET = "GET" HEAD = "HEAD" OPTIONS = "OPTIONS" PATCH = "PATCH" POST = "POST" PUT = "PUT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Router ¶
func (*Router) AddRoute ¶
func (r *Router) AddRoute(method string, pattern string, handler http.HandlerFunc)
Adds a new Route to the Handler
func (*Router) Del ¶
func (r *Router) Del(pattern string, handler http.HandlerFunc)
Del adds a new Route for DELETE requests.
func (*Router) Filter ¶
func (r *Router) Filter(filter http.HandlerFunc)
Filter adds the middleware filter.
func (*Router) FilterParam ¶
func (r *Router) FilterParam(param string, filter http.HandlerFunc)
FilterParam adds the middleware filter iff the URL parameter exists.
func (*Router) FilterPath ¶
func (r *Router) FilterPath(path string, filter http.HandlerFunc)
FilterPath adds the middleware filter iff the path matches the request.
func (*Router) Get ¶
func (r *Router) Get(pattern string, handler http.HandlerFunc)
Get adds a new Route for GET requests.
func (*Router) Patch ¶
func (r *Router) Patch(pattern string, handler http.HandlerFunc)
Patch adds a new Route for PATCH requests.
func (*Router) Post ¶
func (r *Router) Post(pattern string, handler http.HandlerFunc)
Post adds a new Route for POST requests.
func (*Router) Put ¶
func (r *Router) Put(pattern string, handler http.HandlerFunc)
Put adds a new Route for PUT requests.
Click to show internal directories.
Click to hide internal directories.