Documentation
¶
Index ¶
- func File(path string, filename string)
- func LoadTemplates(dir string)
- func RegMethod(method string, fn interface{})
- func Register(method string, path string, fn Handler)
- func RegisterJsonRPC(url string)
- func SetErrorHandler(fn ErrorHandler)
- func SetLogger(l Logger)
- func SetLongQueryHandler(delta time.Duration, fn LongQueryHandler)
- func SetUID(enable bool)
- func Start(addr string) error
- func Static(prefix string, dir string)
- type Context
- func (c *Context) BasicAuth() (string, string, bool)
- func (c *Context) Body() io.ReadCloser
- func (c *Context) BodyJson(res interface{}) error
- func (c *Context) Cookie(name string) string
- func (c *Context) FormValue(name string) string
- func (c *Context) FormValueBool(name string) bool
- func (c *Context) FormValueFloat(name string) float64
- func (c *Context) FormValueInt(name string) int
- func (c *Context) FormValueInt64(name string) int64
- func (c *Context) GetContentType() string
- func (c *Context) GetHeader(key string) string
- func (c *Context) Method() string
- func (c *Context) Param(name string) string
- func (c *Context) ParamBool(name string) bool
- func (c *Context) ParamFloat(name string) float64
- func (c *Context) ParamInt(name string) int
- func (c *Context) ParamInt64(name string) int64
- func (c *Context) Query(name string) string
- func (c *Context) QueryBool(name string) bool
- func (c *Context) QueryFloat(name string) float64
- func (c *Context) QueryInt(name string) int
- func (c *Context) QueryInt64(name string) int64
- func (c *Context) RemoteAddr() string
- func (c *Context) Render(tmpl string, vars map[string]interface{})
- func (c *Context) RenderStr(tmpl string, vars map[string]interface{})
- func (c *Context) RequestPath() string
- func (c *Context) RequestURI() string
- func (c *Context) SetContentType(value string)
- func (c *Context) SetCookie(cookie *http.Cookie)
- func (c *Context) SetHeader(key, value string)
- func (c *Context) StandardError(code int)
- func (c *Context) Write(data []byte)
- func (c *Context) WriteHeader(code int)
- func (c *Context) WriteJson(v interface{})
- func (c *Context) WriteRedirect(dest string)
- func (c *Context) WriteString(txt string)
- type ErrorHandler
- type Handler
- type LogData
- type Logger
- type LongQueryHandler
- type Params
- type Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadTemplates ¶
func LoadTemplates(dir string)
func RegisterJsonRPC ¶
func RegisterJsonRPC(url string)
func SetErrorHandler ¶ added in v1.0.1
func SetErrorHandler(fn ErrorHandler)
func SetLongQueryHandler ¶
func SetLongQueryHandler(delta time.Duration, fn LongQueryHandler)
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) Body ¶
func (c *Context) Body() io.ReadCloser
func (*Context) FormValueBool ¶
func (*Context) FormValueFloat ¶
func (*Context) FormValueInt ¶
func (*Context) FormValueInt64 ¶
func (*Context) GetContentType ¶
func (*Context) ParamFloat ¶
func (*Context) ParamInt64 ¶
func (*Context) QueryFloat ¶
func (*Context) QueryInt64 ¶
func (*Context) RemoteAddr ¶
func (*Context) RequestPath ¶ added in v1.0.2
func (*Context) RequestURI ¶ added in v1.0.2
func (*Context) SetContentType ¶
func (*Context) StandardError ¶
func (*Context) WriteHeader ¶
func (*Context) WriteRedirect ¶
func (*Context) WriteString ¶
type ErrorHandler ¶ added in v1.0.1
type ErrorHandler func(error)
type LongQueryHandler ¶
Click to show internal directories.
Click to hide internal directories.