Documentation ¶
Index ¶
- type Application
- func (application *Application) ApplyConfig(c *web.C, h http.Handler) http.Handler
- func (application *Application) Close()
- func (application *Application) ConnectToDatabase()
- func (application *Application) ConnectToQueues()
- func (application *Application) Init(filename *string)
- func (application *Application) Route(controller interface{}, route string) interface{}
- type Configuration
- type ConfigurationAWS
- type ConfigurationDatabase
- type Controller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Configuration *Configuration DBSession *gorp.DbMap QueueConnection *amqp.Connection QueueChannel *amqp.Channel }
Application holds our app's global variables
func (*Application) ApplyConfig ¶
ApplyConfig makes sure controllers can have access to the database and other variables
func (*Application) Close ¶
func (application *Application) Close()
Close cleans up anything nicely before exiting the process
func (*Application) ConnectToDatabase ¶
func (application *Application) ConnectToDatabase()
ConnectToDatabase initializes our database connection
func (*Application) ConnectToQueues ¶
func (application *Application) ConnectToQueues()
ConnectToQueues initializes our AMQP connection
func (*Application) Init ¶
func (application *Application) Init(filename *string)
Init initializes our globals
func (*Application) Route ¶
func (application *Application) Route(controller interface{}, route string) interface{}
Route defines a web route
type Configuration ¶
type Configuration struct { ListeningPort string `json:"listening_port"` UploadPath string `json:"upload_path"` AMQPServer string `json:"amqp_server"` Database ConfigurationDatabase `json:"database"` Aws ConfigurationAWS `json:"aws"` }
Configuration is the main structure of our config.json file
func (*Configuration) Load ¶
func (configuration *Configuration) Load(filename string) (err error)
Load parses our configuration file
func (*Configuration) Parse ¶
func (configuration *Configuration) Parse(data []byte) (err error)
Parse our configuration file
type ConfigurationAWS ¶
type ConfigurationAWS struct { ExeUpload utils.AwsS3 `json:"exe_upload"` CatalogUpload utils.AwsS3 `json:"catalog_upload"` }
ConfigurationAWS is a sub-element of Configuration
type ConfigurationDatabase ¶
type ConfigurationDatabase struct {
ConnectionString string `json:"connection_string"`
}
ConfigurationDatabase is a sub-element of Configuration
type Controller ¶
type Controller struct { }
Controller struct
func (*Controller) GetDatabase ¶
func (controller *Controller) GetDatabase(c web.C) *gorp.DbMap
GetDatabase helper
func (*Controller) GetQueueChannel ¶
func (controller *Controller) GetQueueChannel(c web.C) *amqp.Channel
GetQueueChannel helper