Documentation ¶
Index ¶
- func GetParams(r *http.Request) *router.Params
- func SetParams(r *http.Request, params httprouter.Params)
- type Router
- func (r *Router) ALL(path string) *middleware.App
- func (r *Router) DELETE(path string) *middleware.App
- func (r *Router) GET(path string) *middleware.App
- func (r *Router) HEAD(path string) *middleware.App
- func (r *Router) Handle(method, path string) *middleware.App
- func (r *Router) OPTIONS(path string) *middleware.App
- func (r *Router) PATCH(path string) *middleware.App
- func (r *Router) POST(path string) *middleware.App
- func (r *Router) PUT(path string) *middleware.App
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) StripPrefix(path string) *middleware.App
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router router main struct.
func (*Router) ALL ¶
func (r *Router) ALL(path string) *middleware.App
ALL return app which will response to all method and path.
func (*Router) DELETE ¶
func (r *Router) DELETE(path string) *middleware.App
DELETE return app which will response to DELETE method and path.
func (*Router) GET ¶
func (r *Router) GET(path string) *middleware.App
GET return app which will response to GET method and path.
func (*Router) HEAD ¶
func (r *Router) HEAD(path string) *middleware.App
HEAD return app which will response to HEAD method and path.
func (*Router) Handle ¶
func (r *Router) Handle(method, path string) *middleware.App
Handle return app which will response to given method and path.
func (*Router) OPTIONS ¶
func (r *Router) OPTIONS(path string) *middleware.App
OPTIONS return app which will response to HEAD method and path. Request called to path which any handle by OPTIONS method will return 404 instead of 405 error due to httprouter.
func (*Router) PATCH ¶
func (r *Router) PATCH(path string) *middleware.App
PATCH return app which will response to PATCH method and path.
func (*Router) POST ¶
func (r *Router) POST(path string) *middleware.App
POST return app which will response to POST method and path.
func (*Router) PUT ¶
func (r *Router) PUT(path string) *middleware.App
PUT return app which will response to PUT method and path.
func (*Router) ServeHTTP ¶
func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP serve router as http.handler.
func (*Router) StripPrefix ¶
func (r *Router) StripPrefix(path string) *middleware.App
StripPrefix strip request prefix and server as a middleware app