interfacer

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2016 License: GPL-2.0, GPL-2.0-or-later Imports: 7 Imported by: 3

README

ladybug.conf is for development testing, not for production.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

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

AppConfig holds and manages configurations of this app

func LoadConfig

func LoadConfig(mode, filename string) *AppConfig

LoadConfig loads application configuration from file and return Config object mode is a string indicates section of config file. filename is config file, used by unit testing Binding address, port are initialized by localhost, 8000

func LoadConfigWithArgs

func LoadConfigWithArgs(mode, addr string, port int, dialect, filename string) *AppConfig

LoadConfigWithArgs initializes with addr, port, db dialect and other options with application configuration from file and return Config object if mode is empty, load only default options (root section) mode is a string indicates section of config file. filename is config file, especially used by unit testing

func (AppConfig) GetBindAddress

func (conf AppConfig) GetBindAddress() string

GetBindAddress returns bind address of this app default value is localhost:8080 if the value is not set For example : dev.wisedog.net:80

func (AppConfig) GetDialect

func (conf AppConfig) GetDialect() string

GetDialect returns database dialect

func (AppConfig) GetMode

func (conf AppConfig) GetMode() string

GetMode returns mode of the app(ex : dev, prod ...)

func (AppConfig) GetValue

func (conf AppConfig) GetValue(key string) string

GetValue returns the appropriate value with given key if any value matched the given key, returns empty string

type AppContext

type AppContext struct {
	Db      *gorm.DB
	Store   *sessions.CookieStore
	Decoder *schema.Decoder
	Config  *AppConfig

	// project-specific fields
	User        *models.User
	ProjectName string
}

AppContext is a context of each request

Jump to

Keyboard shortcuts

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