Documentation ¶
Index ¶
- Variables
- func Close()
- func Delete(route string, handler interface{})
- func Get(route string, handler interface{})
- func HandlerFunc(route string, handler http.Handler)
- func Options(route string, handler interface{})
- func Post(route string, handler interface{})
- func Put(route string, handler interface{})
- func Run(addr string)
- func RunFcgi(addr string)
- func RunScgi(addr string)
- func RunTLS(addr string, tlsConf *tls.Config)
- func Urlencode(data map[string]string) string
- type Context
- func (ctx *Context) Abort(status int, body string)
- func (ctx *Context) ContentType(ext string)
- func (ctx *Context) GetSecureCookie(name string) (string, bool)
- func (ctx *Context) NotFound(message string)
- func (ctx *Context) NotModified()
- func (ctx *Context) Redirect(status int, url_ string)
- func (ctx *Context) SetCookie(name string, value string, age int64)
- func (ctx *Context) SetHeader(hdr string, val string, unique bool)
- func (ctx *Context) SetSecureCookie(name string, val string, age int64)
- func (ctx *Context) WriteString(content string)
- type ResponseWriter
- type Server
- func (s *Server) Close()
- func (s *Server) Delete(route string, handler interface{})
- func (s *Server) Get(route string, handler interface{})
- func (s *Server) Options(route string, handler interface{})
- func (s *Server) Post(route string, handler interface{})
- func (s *Server) Put(route string, handler interface{})
- func (s *Server) Run(addr string)
- func (s *Server) RunFcgi(addr string)
- func (s *Server) RunScgi(addr string)
- func (s *Server) RunTLS(addr string, tlsConf *tls.Config)
- func (s *Server) ServeHTTP(c http.ResponseWriter, req *http.Request)
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = &ServerConfig{ RecoverPanic: true, }
Functions ¶
func Delete ¶
func Delete(route string, handler interface{})
Adds a handler for the 'DELETE' http method.
func HandlerFunc ¶ added in v1.0.0
Adds a generic handler function
Types ¶
type Context ¶
type Context struct { Request *http.Request Params map[string]string Server *Server ResponseWriter }
func (*Context) ContentType ¶ added in v1.0.0
Sets the content type by extension, as defined in the mime package. For example, ctx.ContentType("json") sets the content-type to "application/json"
func (*Context) NotModified ¶ added in v1.0.0
func (ctx *Context) NotModified()
func (*Context) SetSecureCookie ¶
func (*Context) WriteString ¶
type ResponseWriter ¶ added in v1.0.0
type Server ¶ added in v1.0.0
type Server struct { Config *ServerConfig Env map[string]interface{} // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.