Documentation ¶
Index ¶
- func ContextAdapter(handleFunc func(context *Context)) func(w http.ResponseWriter, r *http.Request)
- type Context
- func (c *Context) Header(header string) string
- func (c *Context) Headers() map[string]string
- func (c *Context) Param(param string) (content string)
- func (c *Context) Params() map[string]string
- func (c *Context) Render(statusCode int, src interface{})
- func (c *Context) RenderHTML(statusCode int, html string)
- func (c *Context) RenderText(statusCode int, text string)
- func (c *Context) UnmarshalBody(dest interface{}) error
- func (c *Context) UseCORS()
- type Controller
- type ResponseError
- type Router
- func (r *Router) CONNECT(route string, callback func(context *Context))
- func (r *Router) DELETE(route string, callback func(context *Context))
- func (r *Router) GET(route string, callback func(context *Context))
- func (r *Router) HEAD(route string, callback func(context *Context))
- func (r *Router) OPTIONS(route string, callback func(context *Context))
- func (r *Router) PATCH(route string, callback func(context *Context))
- func (r *Router) POST(route string, callback func(context *Context))
- func (r *Router) PUT(route string, callback func(context *Context))
- func (r *Router) Resource(route string, controller Controller)
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) TRACE(route string, callback func(context *Context))
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextAdapter ¶ added in v0.2.0
func ContextAdapter(handleFunc func(context *Context)) func(w http.ResponseWriter, r *http.Request)
Types ¶
type Context ¶ added in v0.2.0
type Context struct { Request *http.Request Response http.ResponseWriter }
func NewContext ¶ added in v0.2.0
func NewContext(w http.ResponseWriter, r *http.Request) (context *Context)
func (*Context) RenderHTML ¶ added in v0.2.0
func (*Context) RenderText ¶ added in v0.2.0
func (*Context) UnmarshalBody ¶ added in v0.2.0
type Controller ¶ added in v0.2.0
type ResponseError ¶
type Router ¶ added in v0.2.0
func (*Router) Resource ¶ added in v0.2.0
func (r *Router) Resource(route string, controller Controller)
type Template ¶ added in v0.2.0
type Template struct { ProjectName *helpers.Name ResourceName *helpers.Name ResourceFields map[*helpers.Name]string Imports []string }
func NewTemplate ¶ added in v0.2.0
func (*Template) CreateFile ¶ added in v0.2.0
func (*Template) CreateFiles ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.