system

package
v0.0.0-...-06bee79 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2015 License: MIT Imports: 22 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
	DB            *sqlx.DB //has internal threadsafe connection pool
}

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(env *string, box *rice.Box)

func (*Application) LoadTemplates

func (application *Application) LoadTemplates(box *rice.Box) error

func (*Application) Route

func (application *Application) Route(action func(web.C, *http.Request) (string, int)) web.Handler

func (*Application) RunMigrations

func (application *Application) RunMigrations(box *rice.Box, command *string)

type Configuration

type Configuration struct {
	Secret   string `json:"secret"`
	Database ConfigurationDatabase
}

func LoadConfiguration

func LoadConfiguration(env *string, data []byte) (*Configuration, error)

type ConfigurationDatabase

type ConfigurationDatabase struct {
	Host     string `json:"host"`
	Name     string `json:"name"`
	User     string `json:"user"`
	Password string `json:"password"`
}

type Configurations

type Configurations struct {
	Development Configuration
	Production  Configuration
	Testing     Configuration
}

Jump to

Keyboard shortcuts

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