Documentation ¶
Index ¶
Constants ¶
View Source
const ( EnvTesting = "testing" EnvLocal = "local" EnvProduction = "production" )
Environment types.
Variables ¶
View Source
var Config = &Configuration{}
Config is the global configuration instance.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Hostname string `json:"hostname"` Port uint32 `json:"port"` Database string `json:"database"` LogLevel string `json:"log_level"` Username string `json:"username"` Password string `json:"password"` Environment string `json:"environment"` }
Configuration contains all configuration parameters.
func NewConfigFromFile ¶
func NewConfigFromFile(file string) (config *Configuration, err error)
NewConfigFromFile creates a new configuration from a JSON file.
func (*Configuration) IsEnvLocal ¶
func (c *Configuration) IsEnvLocal() bool
IsEnvLocal Returns whether we are in this environment.
func (*Configuration) IsEnvProduction ¶
func (c *Configuration) IsEnvProduction() bool
IsEnvProduction Returns whether we are in this environment.
func (*Configuration) IsEnvTesting ¶
func (c *Configuration) IsEnvTesting() bool
IsEnvTesting Returns whether we are in this environment.
Click to show internal directories.
Click to hide internal directories.