system

package
v0.0.0-...-4547428 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2014 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Configuration *Configuration
	Template      *template.Template
	Store         *sessions.CookieStore
	DBSession     *mgo.Session
}

func (*Application) ApplyAuth

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

func (*Application) ApplyDatabase

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

Makes sure controllers can have access to the database

func (*Application) ApplyGzip

func (application *Application) ApplyGzip(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) ConnectToDatabase

func (application *Application) ConnectToDatabase()

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
}

func (*Configuration) Load

func (configuration *Configuration) Load(filename string) (err error)

func (*Configuration) Parse

func (configuration *Configuration) Parse(data []byte) (err error)

type ConfigurationDatabase

type ConfigurationDatabase struct {
	Hosts    string `json:"hosts"`
	Database string `json:"database"`
}

type Controller

type Controller struct {
}

func (*Controller) GetDatabase

func (controller *Controller) GetDatabase(c web.C) *mgo.Database

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) Parse

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

Jump to

Keyboard shortcuts

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