Documentation ¶
Index ¶
- Constants
- func APIEndpoint(ctx Context)
- func Contexter() flamego.Handler
- func Toggle(options *ToggleOptions) flamego.Handler
- type Context
- func (c *Context) HasError() bool
- func (c *Context) JSON(data interface{}) error
- func (c *Context) JSONError(errorCode int, message string) error
- func (c *Context) Refresh()
- func (c *Context) ServerError() error
- func (c *Context) SetError(err error, f ...interface{})
- func (c Context) SetErrorFlash(message string, tip ...string)
- func (c Context) SetInfoFlash(message string, tip ...string)
- func (c *Context) SetInternalError(f ...interface{})
- func (c Context) SetInternalErrorFlash()
- func (c Context) SetSuccessFlash(message string, tip ...string)
- func (c *Context) SetTitle(title string)
- func (c Context) SetWarningFlash(message string, tip ...string)
- func (c *Context) Success(templateName string)
- type EndpointType
- type Flash
- type FlashType
- type ToggleOptions
Constants ¶
View Source
const ( Info = "info" Success = "success" Warning = "warning" Error = "error" )
Variables ¶
This section is empty.
Functions ¶
func APIEndpoint ¶
func APIEndpoint(ctx Context)
func Toggle ¶
func Toggle(options *ToggleOptions) flamego.Handler
Types ¶
type Context ¶
type Context struct { flamego.Context Data template.Data Session session.Session Template template.Template User *db.User IsLogged bool }
Context represents context of a request.
func (*Context) ServerError ¶
func (Context) SetErrorFlash ¶
func (Context) SetInfoFlash ¶
func (*Context) SetInternalError ¶
func (c *Context) SetInternalError(f ...interface{})
func (Context) SetInternalErrorFlash ¶
func (c Context) SetInternalErrorFlash()
func (Context) SetSuccessFlash ¶
func (Context) SetWarningFlash ¶
type EndpointType ¶
type EndpointType string
const ( EndpointAPI EndpointType = "api" EndpointWeb EndpointType = "web" )
func (EndpointType) IsAPI ¶
func (e EndpointType) IsAPI() bool
func (EndpointType) IsWeb ¶
func (e EndpointType) IsWeb() bool
type ToggleOptions ¶
Click to show internal directories.
Click to hide internal directories.