Documentation ¶
Index ¶
- type Controller
- func (this *Controller) Die(msg ...interface{})
- func (this *Controller) GetConfig() gcore.Config
- func (this *Controller) GetCookie() gcore.Cookies
- func (this *Controller) GetCtx() gcore.Ctx
- func (this *Controller) GetI18n() gcore.I18n
- func (this *Controller) GetLang() string
- func (this *Controller) GetLogger() gcore.Logger
- func (this *Controller) GetParam() gcore.Params
- func (this *Controller) GetRouter() gcore.HTTPRouter
- func (this *Controller) GetSession() gcore.Session
- func (this *Controller) GetSessionStore() gcore.SessionStorage
- func (this *Controller) GetTemplate() gcore.Template
- func (this *Controller) GetView() gcore.View
- func (this *Controller) MethodCallPost()
- func (this *Controller) MethodCallPre(ctx gcore.Ctx)
- func (this *Controller) SessionDestroy() (err error)
- func (this *Controller) SessionStart() (err error)
- func (this *Controller) Stop(msg ...interface{})
- func (this *Controller) StopE(err interface{}, fn ...func())
- func (this *Controller) Tr(key string, defaultText ...string) string
- func (this *Controller) Write(data ...interface{}) (n int, err error)
- func (this *Controller) WriteE(data ...interface{}) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { Response http.ResponseWriter Request *http.Request Param gcore.Params Session gcore.Session Tpl gcore.Template I18n gcore.I18n SessionStore gcore.SessionStorage Router gcore.HTTPRouter Config gcore.Config Cookie gcore.Cookies Ctx gcore.Ctx View gcore.View Lang string Logger gcore.Logger }
Controller gmc web and api controller implements gcore.Controller.
func (*Controller) Die ¶
func (this *Controller) Die(msg ...interface{})
Die will prevent to call After() if have, and MethodCallPost()
func (*Controller) GetConfig ¶
func (this *Controller) GetConfig() gcore.Config
func (*Controller) GetCookie ¶
func (this *Controller) GetCookie() gcore.Cookies
func (*Controller) GetCtx ¶
func (this *Controller) GetCtx() gcore.Ctx
func (*Controller) GetI18n ¶
func (this *Controller) GetI18n() gcore.I18n
func (*Controller) GetLang ¶
func (this *Controller) GetLang() string
func (*Controller) GetLogger ¶
func (this *Controller) GetLogger() gcore.Logger
func (*Controller) GetParam ¶
func (this *Controller) GetParam() gcore.Params
func (*Controller) GetRouter ¶
func (this *Controller) GetRouter() gcore.HTTPRouter
func (*Controller) GetSession ¶
func (this *Controller) GetSession() gcore.Session
func (*Controller) GetSessionStore ¶
func (this *Controller) GetSessionStore() gcore.SessionStorage
func (*Controller) GetTemplate ¶
func (this *Controller) GetTemplate() gcore.Template
func (*Controller) GetView ¶
func (this *Controller) GetView() gcore.View
func (*Controller) MethodCallPost ¶
func (this *Controller) MethodCallPost()
MethodCallPost called after controller method and After() if have.
func (*Controller) MethodCallPre ¶
func (this *Controller) MethodCallPre(ctx gcore.Ctx)
MethodCallPre called before controller method and Before() if have.
func (*Controller) SessionDestroy ¶
func (this *Controller) SessionDestroy() (err error)
func (*Controller) SessionStart ¶
func (this *Controller) SessionStart() (err error)
func (*Controller) Stop ¶
func (this *Controller) Stop(msg ...interface{})
Stop will exit controller method at once
func (*Controller) StopE ¶
func (this *Controller) StopE(err interface{}, fn ...func())
StopE will exit controller method if error is not nil. First argument is an error. Secondary argument is fail function, it be called if error is not nil. Third argument is success function, it be called if error is nil.
func (*Controller) Tr ¶
func (this *Controller) Tr(key string, defaultText ...string) string
Tr translates the key to `this.Lang's` text.
func (*Controller) Write ¶
func (this *Controller) Write(data ...interface{}) (n int, err error)
func (*Controller) WriteE ¶
func (this *Controller) WriteE(data ...interface{}) (n int, err error)
Click to show internal directories.
Click to hide internal directories.