in internal/conf/config.go [104:169]
func setDefaults(c *Config) {
// server
if c.Server.HttpPort == nil {
c.Server.HttpPort = &DefaultHttpPort
}
if c.Server.DisableSSRFToken == nil {
c.Server.DisableSSRFToken = &DefaultDisableSSRFToken
}
if c.Server.SSRFHeaders == nil {
c.Server.SSRFHeaders = &DefaultSSRFHeaders
}
if c.Server.SSRFEnvVariables == nil {
c.Server.SSRFEnvVariables = &DefaultSSRFEnvVariables
}
if c.Server.PathPrefix == nil {
c.Server.PathPrefix = &DefaultPathPrefix
}
if c.Server.MaxConn == nil {
c.Server.MaxConn = &DefaultMaxConnections
}
if c.Server.ResponseType == nil {
c.Server.ResponseType = &DefaultResponseType
}
if c.Server.IgnoreTransientErrors == nil {
c.Server.IgnoreTransientErrors = &DefaultIgnoreTransientErrors
}
// kms
if c.Kms.Region == nil {
c.Kms.Region = &DefaultRegion
}
if c.Kms.Endpoint == nil {
c.Kms.Endpoint = &DefaultEndpoint
}
if c.Kms.CaFilePath == nil {
c.Kms.CaFilePath = &DefaultCaPathFile
}
// cache
if c.Cache.CacheType == nil {
c.Cache.CacheType = &DefaultCache
}
if c.Cache.TtlSeconds == nil || *c.Cache.TtlSeconds == 0 {
c.Cache.TtlSeconds = &DefaultTtlSeconds
}
if c.Cache.CacheSize == nil {
c.Cache.CacheSize = &DefaultCacheSize
}
if c.Cache.EnableLRU == nil {
c.Cache.EnableLRU = &DefaultEnableLRU
}
// log
if c.Log.LogLevel == nil {
c.Log.LogLevel = &DefaultLogLevel
}
if c.Log.LogPath == nil {
c.Log.LogPath = &DefaultLogPath
}
if c.Log.MaxSize == nil {
c.Log.MaxSize = &DefaultLogSize
}
if c.Log.MaxBackups == nil {
c.Log.MaxBackups = &DefaultLogBackups
}
}