Documentation
¶
Index ¶
- type Context
- func (c *Context) Abort()
- func (c *Context) HTML(code int, html string)
- func (c *Context) JSON(code int, data interface{})
- func (c *Context) Next()
- func (c *Context) Params(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, template string, value ...string)
- type Engine
- type H
- type HandlerFunc
- type RouterGroup
- func (group *RouterGroup) DELETE(pattern string, handlerFunc HandlerFunc)
- func (group *RouterGroup) GET(pattern string, handlerFunc HandlerFunc)
- func (group *RouterGroup) Group(prefix string) *RouterGroup
- func (group *RouterGroup) POST(pattern string, handlerFunc HandlerFunc)
- func (group *RouterGroup) PUT(pattern string, handlerFunc HandlerFunc)
- 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 Context struct { // 原始的请求和响应对象 Writer http.ResponseWriter Req *http.Request // 当此请求方式 Method string // 当此请求地址 URL string // contains filtered or unexported fields }
func NewContext ¶
func NewContext(w http.ResponseWriter, r *http.Request) *Context
type Engine ¶
type Engine struct { *RouterGroup // 路由组 // contains filtered or unexported fields }
type RouterGroup ¶
type RouterGroup struct {
// contains filtered or unexported fields
}
func (*RouterGroup) DELETE ¶
func (group *RouterGroup) DELETE(pattern string, handlerFunc HandlerFunc)
func (*RouterGroup) GET ¶
func (group *RouterGroup) GET(pattern string, handlerFunc HandlerFunc)
GET 外部衍生API,提供给用户使用,现在嫁接到RouterGroup上
func (*RouterGroup) Group ¶
func (group *RouterGroup) Group(prefix string) *RouterGroup
func (*RouterGroup) POST ¶
func (group *RouterGroup) POST(pattern string, handlerFunc HandlerFunc)
func (*RouterGroup) PUT ¶
func (group *RouterGroup) PUT(pattern string, handlerFunc HandlerFunc)
Click to show internal directories.
Click to hide internal directories.