Documentation
¶
Index ¶
- Variables
- func Proxy(basePath string, redirectUrl string)
- func Register(handler Handler)
- func Run(addr string) error
- func StaticContent(url, dirname string)
- type Context
- func (c *Context) ReadBytes() []byte
- func (c *Context) ReadForm(data interface{})
- func (c *Context) ReadJson(data interface{})
- func (c *Context) ReadString() string
- func (c *Context) SendJson(data interface{})
- func (c *Context) SendString(data string)
- func (c *Context) SendTemplate(data interface{})
- type Handler
- type HandlerFunc
- type HandlerFuncSet
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TemplatePath = "./templates" AdditionalFuncs template.FuncMap Dev = false )
Functions ¶
func StaticContent ¶
func StaticContent(url, dirname string)
Types ¶
type Context ¶
type Context struct { Writer http.ResponseWriter Request *http.Request Template *template.Template ContextData map[string]interface{} }
func (*Context) ReadString ¶ added in v0.0.2
func (*Context) SendString ¶
func (*Context) SendTemplate ¶
func (c *Context) SendTemplate(data interface{})
type Handler ¶
type Handler struct { Url string Func HandlerFunc TemplateFile string LayoutFile string }
type HandlerFunc ¶
type HandlerFunc func(c *Context)
type HandlerFuncSet ¶
type HandlerFuncSet []HandlerFunc
var ( PreHandlerFuncs HandlerFuncSet PostHandlerFuncs HandlerFuncSet )
func (*HandlerFuncSet) Add ¶
func (h *HandlerFuncSet) Add(handler HandlerFunc)
Directories
¶
Path | Synopsis |
---|---|
examples
|
|
01-simple
command
|
|
02-static
command
|
|
03-pre-post
command
|
|
04-serve-and-proxy
command
|
|
05-response-types
command
|
|
06-json-calculator
command
|
Click to show internal directories.
Click to hide internal directories.