Documentation ¶
Index ¶
- Constants
- func AddFilter(filter Filter)
- func AddRoute(methods int, url string, f actionFunc)
- func AddStaticDir(dir string)
- func RunSimpleServer(addr string)
- func SetTplDelim(leftDelim, rightDelim string)
- func SetTplPath(tplPath string)
- func StartSession(state bool)
- type Context
- func (ctx *Context) Abort(status int, body string)
- func (ctx *Context) ArgumentInt(name string) (int, error)
- func (ctx *Context) ArgumentString(name string) string
- func (ctx *Context) GetArgInt(param string, def int) int
- func (ctx *Context) GetArgStr(param, def string) string
- func (ctx *Context) IsArgExists(param string) bool
- func (ctx *Context) ParseReqBodyJson(obj interface{}) error
- func (ctx *Context) Redirect(url_ string)
- func (ctx *Context) SetStatus(status int)
- func (ctx *Context) WriteHtml(htmlStr string)
- func (ctx *Context) WriteJson(content interface{})
- func (ctx *Context) WriteStream(filename string, contentType string, data []byte)
- func (ctx *Context) WriteTpl(tplName string)
- type Filter
- type Method
- type Server
- func (s *Server) AddFilter(filter Filter)
- func (s *Server) AddRoute(methods int, url string, f actionFunc)
- func (s *Server) AddStaticDir(staticDir string)
- func (s *Server) Run(addr string)
- func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (s *Server) SetTplDelim(leftDelim, rightDelim string)
- func (s *Server) SetTplPath(tplPath string)
- func (s *Server) StartSession(state bool)
- type Session
Constants ¶
View Source
const ( GET = 0x00002000 POST = 0x00004000 PUT = 0x00008000 PATCH = 0x00020000 DELETE = 0x00040000 HEAD = 0x00080000 OPTIONS = 0x00200000 CONNECT = 0x00400000 TRACE = 0x00800000 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct { Request *http.Request ResponseWriter http.ResponseWriter Params map[string]string Data map[string]interface{} //返回参数定义 Session *Session // contains filtered or unexported fields }
请求上下文
func (*Context) IsArgExists ¶
func (*Context) ParseReqBodyJson ¶
将请求数据的json格式信息转换成结构
func (*Context) WriteStream ¶
字符流
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
服务
Source Files ¶
Click to show internal directories.
Click to hide internal directories.