Documentation ¶
Index ¶
- Constants
- type Context
- func (c Context) Get(key string) (interface{}, bool)
- func (c Context) HTML(status int, tpl template.Template, data interface{}) error
- func (c Context) JSON(status int, v interface{}) error
- func (c Context) MustGet(key string) interface{}
- func (c Context) NoContent(status int) error
- func (c *Context) Set(key string, v interface{})
- func (c Context) String(status int, v string) error
- type ErrorHandler
- type HandlerFunc
- type Middleware
- type Router
- func (e Router) DELETE(pattern string, handler HandlerFunc)
- func (e Router) GET(pattern string, handler HandlerFunc)
- func (e Router) OPTIONS(pattern string, handler HandlerFunc)
- func (e Router) PATCH(pattern string, handler HandlerFunc)
- func (e Router) POST(pattern string, handler HandlerFunc)
- func (e Router) PUT(pattern string, handler HandlerFunc)
- func (e Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (e Router) Static(pattern string, root string)
- func (e Router) Sub(prefix string) *Router
- func (e *Router) Use(middleware ...Middleware)
Constants ¶
View Source
const ( MimePlainText = "plain/text" MimeJson = "application/json; charset=utf8" MimeHTML = "text/html" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Request *http.Request Response http.ResponseWriter PathParams httprouter.Params Values map[string]interface{} }
type ErrorHandler ¶
type HandlerFunc ¶
type Middleware ¶
type Middleware func(HandlerFunc) HandlerFunc
type Router ¶
type Router struct { ErrorHandler ErrorHandler // contains filtered or unexported fields }
func (Router) DELETE ¶
func (e Router) DELETE(pattern string, handler HandlerFunc)
func (Router) GET ¶
func (e Router) GET(pattern string, handler HandlerFunc)
func (Router) OPTIONS ¶
func (e Router) OPTIONS(pattern string, handler HandlerFunc)
func (Router) PATCH ¶
func (e Router) PATCH(pattern string, handler HandlerFunc)
func (Router) POST ¶
func (e Router) POST(pattern string, handler HandlerFunc)
func (Router) PUT ¶
func (e Router) PUT(pattern string, handler HandlerFunc)
func (*Router) Use ¶
func (e *Router) Use(middleware ...Middleware)
Click to show internal directories.
Click to hide internal directories.