Documentation ¶
Index ¶
Constants ¶
const ( PRODUCTION = "production" DEVELOPMENT = "development" STAGING = "staging" DEFAULT_CONSUL = "consul" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Env is a reference to our environment configuration object Env *Env // contains filtered or unexported fields }
Config describes our global application configuration element. This structure will wrap any local or remote Viper clients that may be used to retrieve configuration objects from remote service providers such as etcd or Consul.
The struct should also be composed with any additional configuration struct that you define in your application, e.g. "*Env"
func (*Config) IsDebugEnvironment ¶
IsDebugEnvironment returns true if the application is in debug mode
func (*Config) IsDevelopment ¶
IsDevelopment returns whether the application is in dev mode
func (*Config) IsProduction ¶
IsProduction returns true if the application is running in a production environment
type Env ¶
type Env struct { // ApplicationEnvironment provides production, development, or staging environment specification ApplicationEnvironment string `mapstructure:"app_env"` // ApplicationToken is the JWT signing token used to compare incoming authentication requests with the auth middleware ApplicationToken string `mapstructure:"token"` // Debug flags whether the application is running in debugging mode or not (increased log verbosity, no "pm", etc) Debug bool `mapstructure:"debug"` // HTTPHost defines the hostname that the HTTP server will listen on e.g. localhost for development HTTPHost string `mapstructure:"http_host"` // HTTPPort defines the port that the HTTP server will listen on e.g. 80 HTTPPort string `mapstructure:"http_port"` // LogPath is the storage path for Herbert/Monolog style log output LogPath string `mapstructure:"log_path"` // LogChannel defines the channel this application's logs will be tagged with. Within our "golang" app channel // we have defined channels by service. This value may be "gokit-base" for this project. LogChannel string `mapstructure:"channel"` }
Env describes the gokit-base environment configuration. For this app, these values represent JSON data stored in Consul.