Documentation ¶
Index ¶
Constants ¶
View Source
const ( RetryLimitDefault = 5 RetryDelayDefault = 10 * time.Second ConfSourceDefault = ConfSourceEnv SecretSourceDefault = SecretSourceEnv LogFormatDefault = logger.LogFormatText LogLevelDefault = logger.LogLevelInfo ConfSourceEnv = "env" ConfSourceYAML = "yaml" ConfSourceJSON = "json" KeyRetryDelay = "retryDelay" KeyRetryLimit = "retryLimit" KeyURL = "url" KeySecretSource = "secretSource" KeySecretFilename = "secretFilename" KeyLogFormat = "logFormat" KeyLogLevel = "logLevel" EnvRetryDelay = "GOWAIT_RETRY_DELAY" EnvRetryLimit = "GOWAIT_RETRY_LIMIT" EnvURL = "GOWAIT_URL" EnvSecretSource = "GOWAIT_SECRET_SOURCE" EnvSecretFilename = "GOWAIT_SECRET_FILENAME" EnvSecret = "GOWAIT_SECRET" EnvLogFormat = "GOWAIT_LOG_FORMAT" EnvLogLevel = "GOWAIT_LOG_LEVEL" SecretSourceEnv = "env" SecretSourceFile = "file" )
Variables ¶
View Source
var ( EnvironmentVarMap = map[string]string{ EnvRetryDelay: KeyRetryDelay, EnvRetryLimit: KeyRetryLimit, EnvURL: KeyURL, EnvSecretSource: KeySecretSource, EnvSecretFilename: KeySecretFilename, EnvLogFormat: KeyLogFormat, EnvLogLevel: KeyLogLevel, } )
Functions ¶
Types ¶
type AppConfig ¶
type AppConfig struct { Url url.URL `yaml:"url" json:"url"` ConfigSource string `yaml:"-" json:"-"` ConfigFilename string `yaml:"-" json:"-"` Secret string `yaml:"-" json:"-"` SecretSource string `yaml:"secretSource" json:"secretSource"` SecretFilename string `yaml:"secretFilename" json:"secretFilename"` LogFormat string `yaml:"logFormat" json:"logFormat"` LogLevel string `yaml:"logLevel" json:"logLevel"` RetryDelay time.Duration `yaml:"retryDelay" json:"retryDelay"` RetryLimit int `yaml:"retryLimit" json:"retryLimit"` }
AppConfig represents the struct of application configuration info
func (*AppConfig) LoadFromConfigMap ¶
func (*AppConfig) LoadFromJSON ¶
func (*AppConfig) LoadFromYAML ¶
func (*AppConfig) LoadSecret ¶
func (ac *AppConfig) LoadSecret()
func (*AppConfig) PopulateFromAppConfigFile ¶
func (ac *AppConfig) PopulateFromAppConfigFile(fileCfg *AppConfigFile) error
type AppConfigFile ¶
type AppConfigFile struct { Url string `yaml:"url" json:"url"` RetryDelay string `yaml:"retryDelay" json:"retryDelay"` SecretSource string `yaml:"secretSource" json:"secretSource"` SecretFilename string `yaml:"secretFilename" json:"secretFilename"` LogFormat string `yaml:"logFormat" json:"logFormat"` LogLevel string `yaml:"logLevel" json:"logLevel"` RetryLimit int `yaml:"retryLimit" json:"retryLimit"` }
AppConfigFile represents the configuration struct in a flat file
Click to show internal directories.
Click to hide internal directories.