Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DefaultAppEnvironment is the
DefaultAppEnvironment = "development"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { ApplicationEnvironment string `mapstructure:"appEnvironment"` ProjID string `mapstructure:"projectID"` ServiceName string `mapstructure:"serviceName"` LogFormatter string `mapstructure:"logFormatter"` MPrefix string `mapstructure:"metricsPrefix"` TelemetryEnabled bool `mapstructure:"telemetryEnabled"` ErrorAlertingEnabled bool `mapstructure:"errorAlertsEnabled"` MetricsEnabled bool `mapstructure:"metricsEnabled"` TracingEnabled bool `mapstructure:"tracingEnabled"` }
Config stores all service configuration that can be injected via ENV var or falls back to defaults
func Read ¶
func Read() *Config
Read returns an instance of config, initializing it only once ever, handling settings defaults and binding ENV vars to structural config values
func (*Config) MetricsPrefix ¶
func (*Config) Production ¶
Production checks the presence of the ApplicationEnvironment config setting and returns true if it is set to production
Click to show internal directories.
Click to hide internal directories.