Documentation
¶
Index ¶
- Variables
- type HandlerFunc
- type Router
- func (router *Router) AddRule(rule *Rule)
- func (router *Router) Connect(path string, handler HandlerFunc)
- func (router *Router) Delete(path string, handler HandlerFunc)
- func (router *Router) Get(path string, handler HandlerFunc)
- func (router *Router) Head(path string, handler HandlerFunc)
- func (router *Router) Lookup(method string, uri string) (*Rule, bool)
- func (router *Router) Option(path string, handler HandlerFunc)
- func (router *Router) Post(path string, handler HandlerFunc)
- func (router *Router) Put(path string, handler HandlerFunc)
- func (router *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (router *Router) SetNotFound(notFoundHandler HandlerFunc)
- type Rule
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // HTTPMETHOD list the supported http methods. HTTPMETHOD = map[string]bool{ "GET": true, "POST": true, "PUT": true, "DELETE": true, "PATCH": true, "OPTIONS": true, "HEAD": true, "TRACE": true, "CONNECT": true, "MKCOL": true, "COPY": true, "MOVE": true, "PROPFIND": true, "PROPPATCH": true, "LOCK": true, "UNLOCK": true, } )
Functions ¶
This section is empty.
Types ¶
type HandlerFunc ¶
type Router ¶
type Router struct {
Rules []*Rule
NotFound HandlerFunc
// contains filtered or unexported fields
}
func (*Router) Connect ¶
func (router *Router) Connect(path string, handler HandlerFunc)
func (*Router) Delete ¶
func (router *Router) Delete(path string, handler HandlerFunc)
func (*Router) Get ¶
func (router *Router) Get(path string, handler HandlerFunc)
func (*Router) Head ¶
func (router *Router) Head(path string, handler HandlerFunc)
func (*Router) Option ¶
func (router *Router) Option(path string, handler HandlerFunc)
func (*Router) Post ¶
func (router *Router) Post(path string, handler HandlerFunc)
func (*Router) Put ¶
func (router *Router) Put(path string, handler HandlerFunc)
func (*Router) ServeHTTP ¶
func (router *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
implements http.Handler interface.
func (*Router) SetNotFound ¶
func (router *Router) SetNotFound(notFoundHandler HandlerFunc)
Click to show internal directories.
Click to hide internal directories.