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, value string)
- func (c *Context) Status(code int)
- func (c *Context) String(code int, format string, values ...interface{})
- type Engine
- 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) Run(addr string) error
- func (group *RouterGroup) Static(relativePath, 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) LoadHTMLGlob ¶
func (*Engine) SetFuncMap ¶
type HandlerFunc ¶
type HandlerFunc func(*Context)
func Logger ¶
func Logger() HandlerFunc
func Recovery ¶
func Recovery() HandlerFunc
type RouterGroup ¶
type RouterGroup struct {
// contains filtered or unexported fields
}
func (*RouterGroup) GET ¶
func (group *RouterGroup) GET(pattern string, handler HandlerFunc)
func (*RouterGroup) Group ¶
func (group *RouterGroup) Group(prefix string) *RouterGroup
func (*RouterGroup) POST ¶
func (group *RouterGroup) POST(pattern string, handler HandlerFunc)
func (*RouterGroup) Run ¶
func (group *RouterGroup) Run(addr string) error
func (*RouterGroup) Static ¶
func (group *RouterGroup) Static(relativePath, root string)
将某个本地目录,映射到路由 relativePath 上 一般是某些静态文件
func (*RouterGroup) Use ¶
func (group *RouterGroup) Use(middlewares ...HandlerFunc)
Click to show internal directories.
Click to hide internal directories.