system

package
v0.0.0-...-4d7b8f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2015 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterContent

func RegisterContent(name string, data string) error

func RegisterHelper

func RegisterHelper(name string, helper helperFn)

func Render

func Render(data string, context ...interface{}) string

func RenderFile

func RenderFile(filename string, context ...interface{}) string

func RenderFileInLayout

func RenderFileInLayout(filename string, layoutFile string, context ...interface{}) string

func RenderInLayout

func RenderInLayout(data string, layoutData string, context ...interface{}) string

Types

type Application

type Application struct {
	Config         *toml.TomlTree
	Template       *template.Template
	Store          *sessions.CookieStore
	DbMap          *gorp.DbMap
	CsrfProtection *CsrfProtection
}

func (*Application) ApplyAuth

func (application *Application) ApplyAuth(c *web.C, h http.Handler) http.Handler

func (*Application) ApplyCsrfProtection

func (application *Application) ApplyCsrfProtection(c *web.C, h http.Handler) http.Handler

func (*Application) ApplyDbMap

func (application *Application) ApplyDbMap(c *web.C, h http.Handler) http.Handler

func (*Application) ApplyGzip

func (application *Application) ApplyGzip(c *web.C, h http.Handler) http.Handler

func (*Application) ApplyIsXhr

func (application *Application) ApplyIsXhr(c *web.C, h http.Handler) http.Handler

func (*Application) ApplySessions

func (application *Application) ApplySessions(c *web.C, h http.Handler) http.Handler

Makes sure controllers can have access to session

func (*Application) ApplyTemplates

func (application *Application) ApplyTemplates(c *web.C, h http.Handler) http.Handler

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 ConfigurationDatabase struct {
	User     string `json:"user"`
	Password string `json:"password"`
	Hostname string `json:"hostname"`
	Database string `json:"database"`
}

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

func (*Controller) IsXhr

func (controller *Controller) IsXhr(c web.C) bool

func (*Controller) Parse

func (controller *Controller) Parse(t *template.Template, name string, data interface{}) string

type CsrfProtection

type CsrfProtection struct {
	Key    string
	Cookie string
	Header string
	Secure bool
}

type Template

type Template struct {
	// contains filtered or unexported fields
}

func ContentFor

func ContentFor(name string) (*Template, bool)

func ParseFile

func ParseFile(filename string) (*Template, error)

func ParseString

func ParseString(data string) (*Template, error)

func (*Template) Render

func (tmpl *Template) Render(context ...interface{}) string

func (*Template) RenderInLayout

func (tmpl *Template) RenderInLayout(layout *Template, context ...interface{}) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL