Documentation ¶
Index ¶
- type Callback
- type Params
- type Router
- func (router *Router) ClearCache(str string)
- func (router *Router) DELETE(str string, cb Callback)
- func (router *Router) Dir(str string) string
- func (router *Router) EnableHTML(b bool)
- func (router *Router) GET(str string, cb Callback)
- func (router *Router) HEAD(str string, cb Callback)
- func (router *Router) LateRoute(method string, str string, cb Callback)
- func (router *Router) PATCH(str string, cb Callback)
- func (router *Router) POST(str string, cb Callback)
- func (router *Router) PUT(str string, cb Callback)
- func (router *Router) RemoveRoute(str string)
- func (router *Router) Route(method string, str string, cb Callback)
- func (router *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (router *Router) SetNotFound(cb Callback)
- func (router *Router) StaticDir(dir string) func(http.ResponseWriter, *http.Request, Params)
- func (router *Router) StaticFile(fn string) func(http.ResponseWriter, *http.Request, Params)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
create and initialize new router
specify logger to use, or 'nil' to create a new one internally
func (*Router) ClearCache ¶
clear cached routes that match a pattern
func (*Router) EnableHTML ¶
enables html preprocessing for custom include tags
func (*Router) RemoveRoute ¶
remove routes that match a pattern
func (*Router) StaticFile ¶
returns a Callback function for serving a single static file
Click to show internal directories.
Click to hide internal directories.