Documentation
¶
Index ¶
- Constants
- func APIContexter() macaron.Handler
- func APIToggle(options *ToggleOptions) macaron.Handler
- func Contexter() macaron.Handler
- func HTMLContexter() macaron.Handler
- func InitContextConfig(reverseProxyAuthAble, installLock, registerEmailConfirmAble, ... bool, ...)
- func IsAPIPath(url string) bool
- func Toggle(options *ToggleOptions) macaron.Handler
- type APIContext
- type Context
- type HTMLContext
- func (ctx *HTMLContext) Auth()
- func (ctx *HTMLContext) GetErrMsg() string
- func (ctx *HTMLContext) HTML(status int, name infrastructure.TplName)
- func (ctx *HTMLContext) Handle(status int, title string, err error)
- func (ctx *HTMLContext) HasError() bool
- func (ctx *HTMLContext) RenderWithErr(msg string, tpl infrastructure.TplName, form interface{})
- type ToggleOptions
Constants ¶
View Source
const ( TOKEN_TYPE_AUTH = iota TOKEN_TYPE_ACCESS )
Variables ¶
This section is empty.
Functions ¶
func APIContexter ¶
func APIContexter() macaron.Handler
func APIToggle ¶
func APIToggle(options *ToggleOptions) macaron.Handler
func HTMLContexter ¶
func InitContextConfig ¶
func Toggle ¶
func Toggle(options *ToggleOptions) macaron.Handler
Types ¶
type APIContext ¶
type APIContext struct {
*Context
}
func (*APIContext) Auth ¶
func (ctx *APIContext) Auth()
func (*APIContext) Error ¶
func (ctx *APIContext) Error(obj interface{})
func (*APIContext) GetToken ¶
func (ctx *APIContext) GetToken() string
func (*APIContext) JSON ¶
func (ctx *APIContext) JSON(status int, obj interface{})
type Context ¶
type Context struct { *macaron.Context Cache cache.Cache User *model.User SignError error IsSigned bool IsBasicAuth bool }
func (*Context) ServeContent ¶
func (ctx *Context) ServeContent(name string, r io.ReadSeeker, params ...interface{})
type HTMLContext ¶
type HTMLContext struct { *Context Flash *session.Flash Session session.Store // contains filtered or unexported fields }
func (*HTMLContext) Auth ¶
func (ctx *HTMLContext) Auth()
func (*HTMLContext) GetErrMsg ¶
func (ctx *HTMLContext) GetErrMsg() string
func (*HTMLContext) HTML ¶
func (ctx *HTMLContext) HTML(status int, name infrastructure.TplName)
func (*HTMLContext) HasError ¶
func (ctx *HTMLContext) HasError() bool
func (*HTMLContext) RenderWithErr ¶
func (ctx *HTMLContext) RenderWithErr(msg string, tpl infrastructure.TplName, form interface{})
Click to show internal directories.
Click to hide internal directories.