Documentation
¶
Index ¶
- type Context
- func (c *Context) HTML(code int, html string)
- func (c *Context) JSON(code int, data interface{})
- 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
- func (e *Engine) DELETE(pattern string, handlerFunc HandlerFunc)
- func (e *Engine) GET(pattern string, handlerFunc HandlerFunc)
- func (e *Engine) POST(pattern string, handlerFunc HandlerFunc)
- func (e *Engine) PUT(pattern string, handlerFunc HandlerFunc)
- func (e *Engine) Run(addr string) error
- func (e *Engine) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type 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 }
func NewContext ¶
func NewContext(w http.ResponseWriter, r *http.Request) *Context
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) DELETE ¶
func (e *Engine) DELETE(pattern string, handlerFunc HandlerFunc)
func (*Engine) GET ¶
func (e *Engine) GET(pattern string, handlerFunc HandlerFunc)
GET 外部衍生API,提供给用户使用
func (*Engine) POST ¶
func (e *Engine) POST(pattern string, handlerFunc HandlerFunc)
func (*Engine) PUT ¶
func (e *Engine) PUT(pattern string, handlerFunc HandlerFunc)
Click to show internal directories.
Click to hide internal directories.