Documentation ¶
Index ¶
- func RegisterContent(name string, data string) error
- func RegisterHelper(name string, helper helperFn)
- func Render(data string, context ...interface{}) string
- func RenderFile(filename string, context ...interface{}) string
- func RenderFileInLayout(filename string, layoutFile string, context ...interface{}) string
- func RenderInLayout(data string, layoutData string, context ...interface{}) string
- type Application
- func (application *Application) ApplyAuth(c *web.C, h http.Handler) http.Handler
- func (application *Application) ApplyCsrfProtection(c *web.C, h http.Handler) http.Handler
- func (application *Application) ApplyDbMap(c *web.C, h http.Handler) http.Handler
- func (application *Application) ApplyGzip(c *web.C, h http.Handler) http.Handler
- func (application *Application) ApplyIsXhr(c *web.C, h http.Handler) http.Handler
- func (application *Application) ApplySessions(c *web.C, h http.Handler) http.Handler
- func (application *Application) ApplyTemplates(c *web.C, h http.Handler) http.Handler
- func (application *Application) Close()
- func (application *Application) Init(filename *string)
- func (application *Application) LoadTemplates() error
- func (application *Application) Route(controller interface{}, route string) interface{}
- type Configuration
- type ConfigurationDatabase
- type Controller
- func (controller *Controller) GetDbMap(c web.C) *gorp.DbMap
- func (controller *Controller) GetSession(c web.C) *sessions.Session
- func (controller *Controller) GetTemplate(c web.C) *template.Template
- func (controller *Controller) IsXhr(c web.C) bool
- func (controller *Controller) Parse(t *template.Template, name string, data interface{}) string
- type CsrfProtection
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterContent ¶
func RegisterHelper ¶
func RegisterHelper(name string, helper helperFn)
func RenderFile ¶
func RenderFileInLayout ¶
func RenderInLayout ¶
Types ¶
type Application ¶
type Application struct { Config *toml.TomlTree Template *template.Template Store *sessions.CookieStore DbMap *gorp.DbMap CsrfProtection *CsrfProtection }
func (*Application) ApplyCsrfProtection ¶
func (*Application) ApplyDbMap ¶
func (*Application) ApplyIsXhr ¶
func (*Application) ApplySessions ¶
Makes sure controllers can have access to session
func (*Application) ApplyTemplates ¶
Makes sure templates are stored in the context
func (*Application) Close ¶
func (application *Application) Close()
func (*Application) Init ¶
func (application *Application) Init(filename *string)
func (*Application) LoadTemplates ¶
func (application *Application) LoadTemplates() error
func (*Application) Route ¶
func (application *Application) Route(controller interface{}, route string) interface{}
type Configuration ¶
type Configuration struct { Secret string `json:"secret"` PublicPath string `json:"public_path"` TemplatePath string `json:"template_path"` Database ConfigurationDatabase }
type ConfigurationDatabase ¶
type Controller ¶
type Controller struct { }
func (*Controller) GetDbMap ¶
func (controller *Controller) GetDbMap(c web.C) *gorp.DbMap
func (*Controller) GetSession ¶
func (controller *Controller) GetSession(c web.C) *sessions.Session
func (*Controller) GetTemplate ¶
func (controller *Controller) GetTemplate(c web.C) *template.Template
type CsrfProtection ¶
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func ContentFor ¶
func ParseString ¶
func (*Template) RenderInLayout ¶
Click to show internal directories.
Click to hide internal directories.