Documentation ¶
Index ¶
- type Context
- func (c *Context) Data(code int, data []byte)
- func (c *Context) Fail(code int, err string)
- func (c *Context) HTML(code int, name string, data interface{})
- func (c *Context) JSON(code int, obj interface{})
- func (c *Context) Next()
- func (c *Context) Param(key string) string
- func (c *Context) PostForm(key string) string
- func (c *Context) Query(key string) string
- func (c *Context) SetHeader(key string, value string)
- func (c *Context) Status(code int)
- func (c *Context) String(code int, format string, values ...interface{})
- type Engine
- func (engine *Engine) DELETE(pattern string, handler HandlerFunc)
- func (engine *Engine) GET(pattern string, handler HandlerFunc)
- func (engine *Engine) LoadHTMLGlob(pattern string)
- func (engine *Engine) POST(pattern string, handler HandlerFunc)
- func (engine *Engine) PUT(pattern string, handler HandlerFunc)
- func (engine *Engine) Run(addr string) error
- func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (engine *Engine) SetFuncMap(funcMap template.FuncMap)
- type H
- type HandlerFunc
- type RouterGroup
- func (group *RouterGroup) GET(pattern string, handler HandlerFunc)
- func (group *RouterGroup) Group(prefix string) *RouterGroup
- func (group *RouterGroup) POST(pattern string, handler HandlerFunc)
- func (group *RouterGroup) Static(relativePath string, root string)
- func (group *RouterGroup) Use(middlewares ...HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Engine ¶
type Engine struct { *RouterGroup // contains filtered or unexported fields }
func (*Engine) DELETE ¶
func (engine *Engine) DELETE(pattern string, handler HandlerFunc)
func (*Engine) GET ¶
func (engine *Engine) GET(pattern string, handler HandlerFunc)
func (*Engine) LoadHTMLGlob ¶
func (*Engine) POST ¶
func (engine *Engine) POST(pattern string, handler HandlerFunc)
func (*Engine) PUT ¶
func (engine *Engine) PUT(pattern string, handler HandlerFunc)
func (*Engine) ServeHTTP ¶
func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*Engine) SetFuncMap ¶
type RouterGroup ¶
type RouterGroup struct {
// contains filtered or unexported fields
}
func (*RouterGroup) GET ¶
func (group *RouterGroup) GET(pattern string, handler HandlerFunc)
GET defines the method to add GET request
func (*RouterGroup) Group ¶
func (group *RouterGroup) Group(prefix string) *RouterGroup
Group is defined to create a new RouterGroup remember all groups share the same Engine instance
func (*RouterGroup) POST ¶
func (group *RouterGroup) POST(pattern string, handler HandlerFunc)
POST defines the method to add POST request
func (*RouterGroup) Static ¶
func (group *RouterGroup) Static(relativePath string, root string)
serve static files
func (*RouterGroup) Use ¶
func (group *RouterGroup) Use(middlewares ...HandlerFunc)
Use is defined to add middleware to the group
Click to show internal directories.
Click to hide internal directories.