Documentation ¶
Overview ¶
Package config provides configuration for the application.
Index ¶
- Constants
- Variables
- func GetNestedValueFromMap(data map[string]any, key string) any
- func SetNestedValue(v *viper.Viper, key string, value any) error
- type AuthAPIKeyConfig
- type AuthBasicConfig
- type AuthConfig
- type AuthCredentialConfig
- type AuthJWTConfig
- type AuthOAuth2AccessType
- type AuthOAuth2Config
- type AuthOAuth2GrantType
- type AuthPrivateKeyConfig
- type AuthRespectiveConfig
- type AuthType
- type ClockConfig
- type Config
- type CredentialEncryptConfig
- type EncryptConfig
- type EncryptRespectiveConfig
- type EncryptType
- type FakeTimeConfig
- type ForOverride
- type LanguageConfig
- type LanguageType
- type LoaderConfig
- type LoggingConfig
- type LoggingOutputConfig
- type LoggingOutputFormat
- type LoggingOutputLevel
- type LoggingOutputType
- type OutputConfig
- type OutputFormat
- type OutputRespectiveConfig
- type OutputRespectiveValueConfig
- type OutputType
- type OverrideConfig
- type OverrideFileTypes
- type OverrideRespectiveConfig
- type OverrideRespectiveVarConfig
- type OverrideType
- type ServerConfig
- type SlaveCertificateConfig
- type SlaveSettingConfig
- type StoreConfig
- type StoreFileConfig
- type StoreSpecifyConfig
- type TargetConfig
- type TargetRespectiveConfig
- type TargetRespectiveValueConfig
- type TargetType
- type Type
- type ValidAuthAPIKeyConfig
- type ValidAuthBasicConfig
- type ValidAuthConfig
- type ValidAuthCredentialConfig
- type ValidAuthJWTConfig
- type ValidAuthOAuth2Config
- type ValidAuthPrivateKeyConfig
- type ValidAuthRespectiveConfig
- type ValidClockConfig
- type ValidConfig
- type ValidConfigForOverride
- type ValidCredentialEncryptConfig
- type ValidEncryptConfig
- type ValidEncryptRespectiveConfig
- type ValidFakeTimeConfig
- type ValidLanguageConfig
- type ValidLoaderConfig
- type ValidLoggingConfig
- type ValidLoggingOutputConfig
- type ValidOutputConfig
- type ValidOutputRespectiveConfig
- type ValidOutputRespectiveValueConfig
- type ValidOverrideConfig
- type ValidOverrideRespectiveConfig
- type ValidOverrideRespectiveVarConfig
- type ValidServerConfig
- type ValidSlaveCertificateConfig
- type ValidSlaveSettingConfig
- type ValidStoreConfig
- type ValidStoreFileConfig
- type ValidStoreSpecifyConfig
- type ValidTargetConfig
- type ValidTargetRespectiveConfig
- type ValidTargetRespectiveValueConfig
Constants ¶
const DefaultClockFormat = "2006-01-02T15:04:05Z"
DefaultClockFormat is the default clock format
Variables ¶
var ( // ErrTypeInvalid is the error for the invalid config type. ErrTypeInvalid = fmt.Errorf("config type is invalid") // ErrTypeRequired is the error for the required config type. ErrTypeRequired = fmt.Errorf("config type is required") // ErrEnvRequired is the error for the required environment. ErrEnvRequired = fmt.Errorf("environment is required") // ErrLoaderRequired is the error for the required loader. ErrLoaderRequired = fmt.Errorf("loader is required") // ErrTargetsRequired is the error for the required targets. ErrTargetsRequired = fmt.Errorf("targets are required") // ErrOutputsRequired is the error for the required outputs. ErrOutputsRequired = fmt.Errorf("outputs are required") // ErrStoreRequired is the error for the required store. ErrStoreRequired = fmt.Errorf("store is required") // ErrEncryptsRequired is the error for the required encrypts. ErrEncryptsRequired = fmt.Errorf("encrypts are required") // ErrAuthRequired is the error for the required auth. ErrAuthRequired = fmt.Errorf("auth is required") // ErrServerRequired is the error for the required server. ErrServerRequired = fmt.Errorf("server is required") // ErrLoggingRequired is the error for the required logging. ErrLoggingRequired = fmt.Errorf("logging is required") // ErrClockRequired is the error for the required clock. ErrClockRequired = fmt.Errorf("clock is required") // ErrLanguageRequired is the error for the required language. ErrLanguageRequired = fmt.Errorf("language is required") // ErrOverrideRequired is the error for the required override. ErrOverrideRequired = fmt.Errorf("override is required") // ErrSlaveSettingRequired is the error for the required slave ErrSlaveSettingRequired = fmt.Errorf("slave setting is required") // ErrServerPortRequired is the error for the required server port. ErrServerPortRequired = fmt.Errorf("server port is required") // ErrLoggingOutputTypeRequired is the error for the required logging output type. ErrLoggingOutputTypeRequired = fmt.Errorf("logging output type is required") // ErrLoggingOutputFormatRequired is the error for the required logging output format. ErrLoggingOutputFormatRequired = fmt.Errorf("logging output format is required") // ErrLoggingOutputLevelRequired is the error for the required logging output level. ErrLoggingOutputLevelRequired = fmt.Errorf("logging output level is required") // ErrLoggingOutputTypeInvalid is the error for the invalid logging output type. ErrLoggingOutputTypeInvalid = fmt.Errorf("logging output type is invalid") // ErrLoggingOutputFormatInvalid is the error for the invalid logging output format. ErrLoggingOutputFormatInvalid = fmt.Errorf("logging output format is invalid") // ErrLoggingOutputLevelInvalid is the error for the invalid logging output level. ErrLoggingOutputLevelInvalid = fmt.Errorf("logging output level is invalid") // ErrLoggingOutputFilenameRequired is the error for the required logging output filename. ErrLoggingOutputFilenameRequired = fmt.Errorf("logging output filename is required") // ErrLoggingOutputAddressRequired is the error for the required logging output address. ErrLoggingOutputAddressRequired = fmt.Errorf("logging output address is required") // ErrLanguageDefaultRequired is the error for the required language default. ErrLanguageDefaultRequired = fmt.Errorf("language default is required") // ErrLanguageDefaultInvalid is the error for the invalid language default. ErrLanguageDefaultInvalid = fmt.Errorf("language default is invalid") // ErrEncryptIDRequired is the error for the required encrypt ID. ErrEncryptIDRequired = fmt.Errorf("encrypt ID is required") // ErrEncryptIDDuplicate is the error for the duplicate encrypt ID. ErrEncryptIDDuplicate = fmt.Errorf("encrypt ID is duplicate") // ErrEncryptTypeRequired is the error for the required encrypt type. ErrEncryptTypeRequired = fmt.Errorf("encrypt type is required") // ErrEncryptTypeUnsupportedOnSlave is the error for the unsupported encrypt type on the slave. ErrEncryptTypeUnsupportedOnSlave = fmt.Errorf("encrypt type is unsupported on the slave") // ErrEncryptTypeInvalid is the error for the invalid encrypt type. ErrEncryptTypeInvalid = fmt.Errorf("encrypt type is invalid") // ErrEncryptKeyRequired is the error for the required encrypt key. ErrEncryptKeyRequired = fmt.Errorf("encrypt key is required") // ErrEncryptMethodRequired is the error for the required encrypt method. ErrEncryptMethodRequired = fmt.Errorf("encrypt method is required") // ErrEncryptMethodInvalid is the error for the invalid encrypt method. ErrEncryptMethodInvalid = fmt.Errorf("encrypt method is invalid") // ErrEncryptRSAKeySizeInvalid is the error for the invalid encrypt RSA key size. ErrEncryptRSAKeySizeInvalid = fmt.Errorf("encrypt RSA key size is invalid, must be 16, 24, or 32 bytes") // ErrEncryptStoreRequired is the error for the required encrypt store. ErrEncryptStoreRequired = fmt.Errorf("encrypt store is required") // ErrClockFormatInvalid is the error for the invalid clock format. ErrClockFormatInvalid = fmt.Errorf("clock format is invalid") // ErrClockFakeTimeRequired is the error for the required clock fake time. ErrClockFakeTimeRequired = fmt.Errorf("clock fake time is required") // ErrClockFakeTimeInvalid is the error for the invalid clock fake time. ErrClockFakeTimeInvalid = fmt.Errorf("clock fake time is invalid") // ErrStoreFilePathRequired is the error for the required store filepath. ErrStoreFilePathRequired = fmt.Errorf("store filepath is required") // ErrStoreFileEnvRequired is the error for the required store file env. ErrStoreFileEnvRequired = fmt.Errorf("store file env is required") // ErrStoreBucketIDRequired is the error for the required store bucket ID. ErrStoreBucketIDRequired = fmt.Errorf("store bucket ID is required") // ErrStoreBucketIDDuplicate is the error for the duplicate store bucket ID. ErrStoreBucketIDDuplicate = fmt.Errorf("store bucket ID is duplicate") // ErrStoreKeyRequired is the error for the required store key. ErrStoreKeyRequired = fmt.Errorf("store key is required") // ErrStoreEncryptIDRequired is the error for the required store encrypt ID. ErrStoreEncryptIDRequired = fmt.Errorf("store encrypt ID is required") // ErrAuthIDRequired is the error for the required auth ID. ErrAuthIDRequired = fmt.Errorf("auth ID is required") // ErrAuthIDDuplicate is the error for the duplicate auth ID. ErrAuthIDDuplicate = fmt.Errorf("auth ID is duplicate") // ErrAuthTypeRequired is the error for the required auth type. ErrAuthTypeRequired = fmt.Errorf("auth type is required") // ErrAuthTypeInvalid is the error for the invalid auth type. ErrAuthTypeInvalid = fmt.Errorf("auth type is invalid") // ErrAuthDefaultDuplicate is the error for the duplicate auth default. ErrAuthDefaultDuplicate = fmt.Errorf("auth default is duplicate") // ErrAuthCredentialStoreRequired is the error for the required auth credential store. ErrAuthCredentialStoreRequired = fmt.Errorf("auth credential store is required") // ErrAuthOAuth2Required is the error for the required auth OAuth2. ErrAuthOAuth2Required = fmt.Errorf("auth OAuth2 is required") // ErrAuthOAuth2GrantTypeRequired is the error for the required auth OAuth2 grant type. ErrAuthOAuth2GrantTypeRequired = fmt.Errorf("auth OAuth2 grant type is required") // ErrAuthOAuth2GrantTypeInvalid is the error for the invalid auth OAuth2 grant type. ErrAuthOAuth2GrantTypeInvalid = fmt.Errorf("auth OAuth2 grant type is invalid") // ErrAuthOAuth2ClientIDRequired is the error for the required auth OAuth2 client ID. ErrAuthOAuth2ClientIDRequired = fmt.Errorf("auth OAuth2 client ID is required") // ErrAuthOAuth2ClientSecretRequired is the error for the required auth OAuth2 client secret. ErrAuthOAuth2ClientSecretRequired = fmt.Errorf("auth OAuth2 client secret is required") // ErrAuthOAuth2AuthURLRequired is the error for the required auth OAuth2 auth URL. ErrAuthOAuth2AuthURLRequired = fmt.Errorf("auth OAuth2 auth URL is required") // ErrAuthOAuth2TokenURLRequired is the error for the required auth OAuth2 token URL. ErrAuthOAuth2TokenURLRequired = fmt.Errorf("auth OAuth2 token URL is required") // ErrAuthOAuth2AccessTypeRequired is the error for the required auth OAuth2 access type. ErrAuthOAuth2AccessTypeRequired = fmt.Errorf("auth OAuth2 access type is required") // ErrAuthOAuth2AccessTypeInvalid is the error for the invalid auth OAuth2 access type. ErrAuthOAuth2AccessTypeInvalid = fmt.Errorf("auth OAuth2 access type is invalid") // ErrAuthOAuth2UsernameRequired is the error for the required auth OAuth2 username. ErrAuthOAuth2UsernameRequired = fmt.Errorf("auth OAuth2 username is required") // ErrAuthOAuth2PasswordRequired is the error for the required auth OAuth2 password. ErrAuthOAuth2PasswordRequired = fmt.Errorf("auth OAuth2 password is required") // ErrAuthOAuth2CredentialRequired is the error for the required auth OAuth2 credential. ErrAuthOAuth2CredentialRequired = fmt.Errorf("auth OAuth2 credential is required") // ErrAuthAPIKeyRequired is the error for the required auth API key. ErrAuthAPIKeyRequired = fmt.Errorf("auth API key is required") // ErrAuthAPIKeyHeaderNameRequired is the error for the required auth API key header name. ErrAuthAPIKeyHeaderNameRequired = fmt.Errorf("auth API key header name is required") // ErrAuthAPIKeyKeyRequired is the error for the required auth API key key. ErrAuthAPIKeyKeyRequired = fmt.Errorf("auth API key key is required") // ErrAuthBasicRequired is the error for the required auth basic. ErrAuthBasicRequired = fmt.Errorf("auth basic is required") // ErrAuthBasicUsernameRequired is the error for the required auth basic username. ErrAuthBasicUsernameRequired = fmt.Errorf("auth basic username is required") // ErrAuthBasicPasswordRequired is the error for the required auth basic password. ErrAuthBasicPasswordRequired = fmt.Errorf("auth basic password is required") // ErrAuthPrivateKeyRequired is the error for the required auth private key. ErrAuthPrivateKeyRequired = fmt.Errorf("auth private key is required") // ErrAuthPrivateKeyPrivateKeyRequired is the error for the required auth private key private key. ErrAuthPrivateKeyPrivateKeyRequired = fmt.Errorf("auth private key is required on private key auth") // ErrAuthJWTRequired is the error for the required auth JWT. ErrAuthJWTRequired = fmt.Errorf("auth JWT is required") // ErrAuthJWTCredentialRequired is the error for the required auth JWT credential. ErrAuthJWTCredentialRequired = fmt.Errorf("auth JWT credential is required") // ErrTargetIDRequired is the error for the required target ID. ErrTargetIDRequired = fmt.Errorf("target ID is required") // ErrTargetIDDuplicate is the error for the duplicate target ID. ErrTargetIDDuplicate = fmt.Errorf("target ID is duplicate") // ErrTargetTypeRequired is the error for the required target type. ErrTargetTypeRequired = fmt.Errorf("target type is required") // ErrTargetTypeInvalid is the error for the invalid target type. ErrTargetTypeInvalid = fmt.Errorf("target type is invalid") // ErrTargetValueEnvRequired is the error for the required target value env. ErrTargetValueEnvRequired = fmt.Errorf("target value env is required") // ErrTargetValueURLRequired is the error for the required target value URL. ErrTargetValueURLRequired = fmt.Errorf("target value URL is required") // ErrOutputValueEnvRequired is the error for the required output value env. ErrOutputValueEnvRequired = fmt.Errorf("output value env is required") // ErrOutputValueTypeRequired is the error for the required output value type. ErrOutputValueTypeRequired = fmt.Errorf("output value type is required") // ErrOutputValueTypeInvalid is the error for the invalid output value type. ErrOutputValueTypeInvalid = fmt.Errorf("output value type is invalid") // ErrOutputValueFormatRequired is the error for the required output value format. ErrOutputValueFormatRequired = fmt.Errorf("output value format is required") // ErrOutputValueFormatInvalid is the error for the invalid output value format. ErrOutputValueFormatInvalid = fmt.Errorf("output value format is invalid") // ErrOutputValueBasePathRequired is the error for the required output value base path. ErrOutputValueBasePathRequired = fmt.Errorf("output value base path is required") // ErrOutputValueIDRequired is the error for the required output value ID. ErrOutputValueIDRequired = fmt.Errorf("output value ID is required") // ErrOutputValueIDDuplicate is the error for the duplicate output value ID. ErrOutputValueIDDuplicate = fmt.Errorf("output value ID is duplicate") // ErrOverrideVarKeyRequired is the error for the required override var key. ErrOverrideVarKeyRequired = fmt.Errorf("override var key is required") // ErrOverrideVarValueRequired is the error for the required override var value. ErrOverrideVarValueRequired = fmt.Errorf("override var value is required") // ErrOverrideTypeRequired is the error for the required override type. ErrOverrideTypeRequired = fmt.Errorf("override type is required") // ErrOverrideTypeInvalid is the error for the invalid override type. ErrOverrideTypeInvalid = fmt.Errorf("override type is invalid") // ErrOverrideFileTypeRequired is the error for the required override file type. ErrOverrideFileTypeRequired = fmt.Errorf("override file type is required") // ErrOverrideFileTypeInvalid is the error for the invalid override file type. ErrOverrideFileTypeInvalid = fmt.Errorf("override file type is invalid") // ErrOverridePathRequired is the error for the required override path. ErrOverridePathRequired = fmt.Errorf("override path is required") // ErrOverrideStoreRequired is the error for the required override store. ErrOverrideStoreRequired = fmt.Errorf("override store is required") // ErrOverrideKeyRequired is the error for the required override key. ErrOverrideKeyRequired = fmt.Errorf("override key is required") // ErrOverrideValueRequired is the error for the required override value. ErrOverrideValueRequired = fmt.Errorf("override value is required") // ErrLoaderBasePathRequired is the error for the required loader base path. ErrLoaderBasePathRequired = fmt.Errorf("loader base path is required") // ErrSlaveSettingPortRequired is the error for the required slave setting port. ErrSlaveSettingPortRequired = fmt.Errorf("slave setting port is required") // ErrSlaveCertificateSlaveCertPathRequired is the error for the required slave certificate slave certificate path. ErrSlaveCertificateSlaveCertPathRequired = fmt.Errorf("slave certificate slave certificate path is required") // ErrSlaveCertificateSlaveKeyPathRequired is the error for the required slave certificate slave key path. ErrSlaveCertificateSlaveKeyPathRequired = fmt.Errorf("slave certificate slave key path is required") // ErrSlaveSettingEncryptIDRequired is the error for the required slave setting encrypt ID. ErrSlaveSettingEncryptIDRequired = fmt.Errorf("slave setting encrypt ID is required") )
Functions ¶
func GetNestedValueFromMap ¶
GetNestedValueFromMap gets a nested value from a map
Types ¶
type AuthAPIKeyConfig ¶
type AuthAPIKeyConfig struct { HeaderName *string `mapstructure:"header_name"` Key *string `mapstructure:"key"` }
AuthAPIKeyConfig is the configuration for the api key.
func (AuthAPIKeyConfig) Validate ¶
func (c AuthAPIKeyConfig) Validate() (ValidAuthAPIKeyConfig, error)
Validate validates the api key configuration.
type AuthBasicConfig ¶
type AuthBasicConfig struct { Username *string `mapstructure:"username"` Password *string `mapstructure:"password"` }
AuthBasicConfig is the configuration for the basic auth.
func (AuthBasicConfig) Validate ¶
func (c AuthBasicConfig) Validate() (ValidAuthBasicConfig, error)
Validate validates the basic auth configuration.
type AuthConfig ¶
type AuthConfig []AuthRespectiveConfig
AuthConfig is the configuration for the auth.
func (AuthConfig) Validate ¶
func (c AuthConfig) Validate() (ValidAuthConfig, error)
Validate validates the auth configuration.
type AuthCredentialConfig ¶
type AuthCredentialConfig struct {
Store *StoreSpecifyConfig `mapstructure:"store"`
}
AuthCredentialConfig is the configuration for the credential.
func (AuthCredentialConfig) Validate ¶
func (c AuthCredentialConfig) Validate() (ValidAuthCredentialConfig, error)
Validate validates the credential configuration.
type AuthJWTConfig ¶
type AuthJWTConfig struct {
Credential *AuthCredentialConfig `mapstructure:"credential"`
}
AuthJWTConfig is the configuration for the jwt.
func (AuthJWTConfig) Validate ¶
func (c AuthJWTConfig) Validate() (ValidAuthJWTConfig, error)
Validate validates the jwt configuration.
type AuthOAuth2AccessType ¶
type AuthOAuth2AccessType string
AuthOAuth2AccessType is the access type of the oauth2.
const ( // AuthOAuth2AccessTypeOnline is the access type of the online. AuthOAuth2AccessTypeOnline AuthOAuth2AccessType = "online" // AuthOAuth2AccessTypeOffline is the access type of the offline. AuthOAuth2AccessTypeOffline AuthOAuth2AccessType = "offline" )
type AuthOAuth2Config ¶
type AuthOAuth2Config struct { GrantType *string `mapstructure:"grant_type"` ClientID *string `mapstructure:"client_id"` Scope []string `mapstructure:"scope"` ClientSecret string `mapstructure:"client_secret"` AccessType *string `mapstructure:"access_type"` AuthURL *string `mapstructure:"auth_url"` TokenURL *string `mapstructure:"token_url"` Username *string `mapstructure:"username"` Password *string `mapstructure:"password"` Credential *AuthCredentialConfig `mapstructure:"credential"` }
AuthOAuth2Config is the configuration for the oauth2.
func (AuthOAuth2Config) Validate ¶
func (c AuthOAuth2Config) Validate() (ValidAuthOAuth2Config, error)
Validate validates the oauth2 configuration.
type AuthOAuth2GrantType ¶
type AuthOAuth2GrantType string
AuthOAuth2GrantType is the grant type of the oauth2.
const ( // AuthOAuth2GrantTypeAuthorizationCode is the grant type of the authorization code. AuthOAuth2GrantTypeAuthorizationCode AuthOAuth2GrantType = "authorization_code" // AuthOAuth2GrantTypeClientCredentials is the grant type of the client credentials. AuthOAuth2GrantTypeClientCredentials AuthOAuth2GrantType = "client_credentials" // AuthOAuth2GrantTypePassword is the grant type of the password. AuthOAuth2GrantTypePassword AuthOAuth2GrantType = "password" )
type AuthPrivateKeyConfig ¶
type AuthPrivateKeyConfig struct {
PrivateKey *string `mapstructure:"private_key"`
}
AuthPrivateKeyConfig is the configuration for the private key.
func (AuthPrivateKeyConfig) Validate ¶
func (c AuthPrivateKeyConfig) Validate() (ValidAuthPrivateKeyConfig, error)
Validate validates the private key configuration.
type AuthRespectiveConfig ¶
type AuthRespectiveConfig struct { ID *string `mapstructure:"id"` Default bool `mapstructure:"default"` Type *string `mapstructure:"type"` OAuth2 *AuthOAuth2Config `mapstructure:"oauth2"` APIKey *AuthAPIKeyConfig `mapstructure:"api_key"` Basic *AuthBasicConfig `mapstructure:"basic"` PrivateKey *AuthPrivateKeyConfig `mapstructure:"private_key"` JWT *AuthJWTConfig `mapstructure:"jwt"` }
AuthRespectiveConfig is the configuration for the respective auth.
type AuthType ¶
type AuthType string
AuthType is the type of the auth.
const ( // AuthTypeOAuth2 is the type of the oauth2. AuthTypeOAuth2 AuthType = "oauth2" // AuthTypeAPIKey is the type of the api key. AuthTypeAPIKey AuthType = "apiKey" // AuthTypeBasic is the type of the basic auth. AuthTypeBasic AuthType = "basic" // AuthTypePrivateKey is the type of the private key. AuthTypePrivateKey AuthType = "privateKey" // AuthTypeJWT is the type of the jwt. AuthTypeJWT AuthType = "jwt" )
type ClockConfig ¶
type ClockConfig struct { Format *string `mapstructure:"format"` Fake FakeTimeConfig `mapstructure:"fake"` }
ClockConfig represents the configuration for the clock
func (ClockConfig) Validate ¶
func (c ClockConfig) Validate() (ValidClockConfig, error)
Validate validates the clock configuration.
type Config ¶
type Config struct { Type *string `mapstructure:"type"` Env *string `mapstructure:"env"` Loader *LoaderConfig `mapstructure:"loader"` Targets *TargetConfig `mapstructure:"targets"` Outputs *OutputConfig `mapstructure:"outputs"` Store *StoreConfig `mapstructure:"store"` Encrypts *EncryptConfig `mapstructure:"encrypts"` Auth *AuthConfig `mapstructure:"auth"` Server *ServerConfig `mapstructure:"server"` Logging *LoggingConfig `mapstructure:"logging"` Clock *ClockConfig `mapstructure:"clock"` Language *LanguageConfig `mapstructure:"language"` Override *OverrideConfig `mapstructure:"override"` SlaveSetting *SlaveSettingConfig `mapstructure:"slave_setting"` }
Config represents the application configuration
func (Config) Validate ¶
func (c Config) Validate() (ValidConfig, error)
Validate validates the configuration
type CredentialEncryptConfig ¶
type CredentialEncryptConfig struct { Enabled bool `mapstructure:"enabled"` EncryptID *string `mapstructure:"encrypt_id"` }
CredentialEncryptConfig is the configuration for the credential encrypt.
type EncryptConfig ¶
type EncryptConfig []EncryptRespectiveConfig
EncryptConfig is the configuration for the encrypt.
func (EncryptConfig) Validate ¶
func (c EncryptConfig) Validate() (ValidEncryptConfig, error)
Validate validates the encrypt configuration.
func (EncryptConfig) ValidateOnSlave ¶
func (c EncryptConfig) ValidateOnSlave() (ValidEncryptConfig, error)
ValidateOnSlave validates the encrypt configuration on the slave.
type EncryptRespectiveConfig ¶
type EncryptRespectiveConfig struct { ID *string `mapstructure:"id"` Type *string `mapstructure:"type"` Key *string `mapstructure:"key"` Store *StoreSpecifyConfig `mapstructure:"store"` }
EncryptRespectiveConfig is the configuration for the encrypt.
type EncryptType ¶
type EncryptType string
EncryptType is the type of the encrypt.
const ( // EncryptTypeStaticCBC is the type of the static cbc. EncryptTypeStaticCBC EncryptType = "staticCBC" // EncryptTypeStaticCFB is the type of the static cfb. EncryptTypeStaticCFB EncryptType = "staticCFB" // EncryptTypeStaticCTR is the type of the static ctr. EncryptTypeStaticCTR EncryptType = "staticCTR" // EncryptTypeDynamicCBC is the type of the dynamic cbc. EncryptTypeDynamicCBC EncryptType = "dynamicCBC" // EncryptTypeDynamicCFB is the type of the dynamic cfb. EncryptTypeDynamicCFB EncryptType = "dynamicCFB" // EncryptTypeDynamicCTR is the type of the dynamic ctr. EncryptTypeDynamicCTR EncryptType = "dynamicCTR" )
type FakeTimeConfig ¶
type FakeTimeConfig struct { Enabled bool `mapstructure:"enabled"` Time *string `mapstructure:"time"` }
FakeTimeConfig represents the configuration for the fake time
type ForOverride ¶
type ForOverride struct { Env *string `mapstructure:"env"` Override *OverrideConfig `mapstructure:"override"` }
ForOverride represents the configuration for the override service
func (ForOverride) Validate ¶
func (c ForOverride) Validate() (ValidConfigForOverride, error)
Validate validates the configuration for the override service
type LanguageConfig ¶
type LanguageConfig struct {
Default *string `mapstructure:"default"`
}
LanguageConfig represents the language configuration
func (LanguageConfig) Validate ¶
func (l LanguageConfig) Validate() (ValidLanguageConfig, error)
Validate validates the language configuration
type LanguageType ¶
type LanguageType string
LanguageType is the type of the language.
const ( // LanguageTypeEnglish is the type of the english. LanguageTypeEnglish LanguageType = "en" // LanguageTypeJapanese is the type of the japanese. LanguageTypeJapanese LanguageType = "ja" )
type LoaderConfig ¶
type LoaderConfig struct {
BasePath *string `mapstructure:"base_path"`
}
LoaderConfig represents the configuration for the loader service
func (LoaderConfig) Validate ¶
func (c LoaderConfig) Validate() (ValidLoaderConfig, error)
Validate validates the loader configuration
type LoggingConfig ¶
type LoggingConfig struct {
Output []LoggingOutputConfig `mapstructure:"output"`
}
LoggingConfig represents the configuration for logging
func (LoggingConfig) Validate ¶
func (l LoggingConfig) Validate() (ValidLoggingConfig, error)
Validate validates the logging configuration
type LoggingOutputConfig ¶
type LoggingOutputConfig struct { Type *string `mapstructure:"type"` Format *string `mapstructure:"format"` Level *string `mapstructure:"level"` Filename *string `mapstructure:"filename"` Address *string `mapstructure:"address"` EnabledEnv *[]string `mapstructure:"enabled_env"` }
LoggingOutputConfig represents the configuration for logging output
type LoggingOutputFormat ¶
type LoggingOutputFormat string
LoggingOutputFormat is the format of the logging output.
const ( // LoggingOutputFormatJSON is the format of the json. LoggingOutputFormatJSON LoggingOutputFormat = "json" // LoggingOutputFormatText is the format of the text. LoggingOutputFormatText LoggingOutputFormat = "text" )
type LoggingOutputLevel ¶
type LoggingOutputLevel string
LoggingOutputLevel is the level of the logging output.
const ( // LoggingOutputLevelDebug is the level of the debug. LoggingOutputLevelDebug LoggingOutputLevel = "debug" // LoggingOutputLevelInfo is the level of the info. LoggingOutputLevelInfo LoggingOutputLevel = "info" // LoggingOutputLevelWarn is the level of the warn. LoggingOutputLevelWarn LoggingOutputLevel = "warn" // LoggingOutputLevelError is the level of the error. LoggingOutputLevelError LoggingOutputLevel = "error" )
type LoggingOutputType ¶
type LoggingOutputType string
LoggingOutputType is the type of the logging output.
const ( // LoggingOutputTypeFile is the type of the file. LoggingOutputTypeFile LoggingOutputType = "file" // LoggingOutputTypeStdout is the type of the stdout. LoggingOutputTypeStdout LoggingOutputType = "stdout" // LoggingOutputTypeTCP is the type of the tcp. LoggingOutputTypeTCP LoggingOutputType = "tcp" )
type OutputConfig ¶
type OutputConfig []OutputRespectiveConfig
OutputConfig represents the configuration for the output service
func (OutputConfig) Validate ¶
func (c OutputConfig) Validate() (ValidOutputConfig, error)
Validate validates the output configuration
type OutputFormat ¶
type OutputFormat string
OutputFormat represents the format of the output service
const ( // OutputFormatCSV represents the CSV output service OutputFormatCSV OutputFormat = "csv" )
type OutputRespectiveConfig ¶
type OutputRespectiveConfig struct { ID *string `mapstructure:"id"` Values []OutputRespectiveValueConfig `mapstructure:"values"` }
OutputRespectiveConfig is a struct that represents the output configuration
type OutputRespectiveValueConfig ¶
type OutputRespectiveValueConfig struct { Env *string `mapstructure:"env"` Type *string `mapstructure:"type"` Format *string `mapstructure:"format"` BasePath *string `mapstructure:"base_path"` }
OutputRespectiveValueConfig represents the configuration for the output respective service value
func (OutputRespectiveValueConfig) Validate ¶
func (c OutputRespectiveValueConfig) Validate() (ValidOutputRespectiveValueConfig, error)
Validate validates the output respective value configuration
type OutputType ¶
type OutputType string
OutputType represents the type of the output service
const ( // OutputTypeLocal represents the Local output service OutputTypeLocal OutputType = "local" )
type OverrideConfig ¶
type OverrideConfig []OverrideRespectiveConfig
OverrideConfig represents the configuration for the override service
func (OverrideConfig) Validate ¶
func (c OverrideConfig) Validate() (ValidOverrideConfig, error)
Validate validates the override configuration
type OverrideFileTypes ¶
type OverrideFileTypes string
OverrideFileTypes represents the file types for the override respective service
const ( // OverrideFileTypesYAML represents the YAML file type for the override respective service OverrideFileTypesYAML OverrideFileTypes = "yaml" )
type OverrideRespectiveConfig ¶
type OverrideRespectiveConfig struct { Type *string `mapstructure:"type"` FileType *string `mapstructure:"file_type"` Path *string `mapstructure:"path"` Partial bool `mapstructure:"partial"` Vars []OverrideRespectiveVarConfig `mapstructure:"vars"` Store *StoreSpecifyConfig `mapstructure:"store"` Key *string `mapstructure:"key"` Value *string `mapstructure:"value"` EnabledEnv *[]string `mapstructure:"enabled_env"` }
OverrideRespectiveConfig represents the configuration for the override respective service
type OverrideRespectiveVarConfig ¶
type OverrideRespectiveVarConfig struct { Key *string `mapstructure:"key"` Value *string `mapstructure:"value"` }
OverrideRespectiveVarConfig represents the configuration for the override respective service var
func (OverrideRespectiveVarConfig) Validate ¶
func (c OverrideRespectiveVarConfig) Validate() (ValidOverrideRespectiveVarConfig, error)
Validate validates the override respective var configuration
type OverrideType ¶
type OverrideType string
OverrideType represents the type of the override service
const ( // OverrideTypeStatic represents the Static override service OverrideTypeStatic OverrideType = "static" // OverrideTypeFile represents the File override service OverrideTypeFile OverrideType = "file" )
type ServerConfig ¶
type ServerConfig struct { Port *int `mapstructure:"port"` RedirectPort *int `mapstructure:"redirect_port"` }
ServerConfig represents the server configuration
func (ServerConfig) Validate ¶
func (s ServerConfig) Validate() (ValidServerConfig, error)
Validate validates the server configuration
type SlaveCertificateConfig ¶
type SlaveCertificateConfig struct { Enabled bool `mapstructure:"enabled"` SlaveCert *string `mapstructure:"slave_cert"` SlaveKey *string `mapstructure:"slave_key"` }
SlaveCertificateConfig represents the configuration for the slave certificate
func (SlaveCertificateConfig) Validate ¶
func (c SlaveCertificateConfig) Validate() (ValidSlaveCertificateConfig, error)
Validate validates the slave certificate configuration.
type SlaveSettingConfig ¶
type SlaveSettingConfig struct { Port *int `mapstructure:"port"` Certificate SlaveCertificateConfig `mapstructure:"certificate"` Encrypt CredentialEncryptConfig `mapstructure:"encrypt"` }
SlaveSettingConfig represents the configuration for the slave setting
func (SlaveSettingConfig) Validate ¶
func (c SlaveSettingConfig) Validate() (ValidSlaveSettingConfig, error)
Validate validates the slave setting configuration.
type StoreConfig ¶
type StoreConfig struct { File []StoreFileConfig `mapstructure:"file"` Buckets []string `mapstructure:"buckets"` }
StoreConfig represents the configuration for the respective store.
func (StoreConfig) Validate ¶
func (c StoreConfig) Validate() (ValidStoreConfig, error)
Validate validates the store configuration.
type StoreFileConfig ¶
StoreFileConfig represents the configuration for the file store.
type StoreSpecifyConfig ¶
type StoreSpecifyConfig struct { BucketID *string `mapstructure:"bucket_id"` Key *string `mapstructure:"key"` Encrypt CredentialEncryptConfig `mapstructure:"encrypt"` }
StoreSpecifyConfig represents the configuration for the store
func (StoreSpecifyConfig) Validate ¶
func (c StoreSpecifyConfig) Validate() (ValidStoreSpecifyConfig, error)
Validate validates the store configuration.
type TargetConfig ¶
type TargetConfig []TargetRespectiveConfig
TargetConfig represents the configuration for the target service
func (TargetConfig) Validate ¶
func (c TargetConfig) Validate() (ValidTargetConfig, error)
Validate validates the target configuration
type TargetRespectiveConfig ¶
type TargetRespectiveConfig struct { ID *string `mapstructure:"id"` Type *string `mapstructure:"type"` Values []TargetRespectiveValueConfig `mapstructure:"values"` }
TargetRespectiveConfig represents the configuration for the target respective service
type TargetRespectiveValueConfig ¶
type TargetRespectiveValueConfig struct { Env *string `mapstructure:"env"` URL *string `mapstructure:"url"` }
TargetRespectiveValueConfig represents the configuration for the target respective service value
func (TargetRespectiveValueConfig) Validate ¶
func (c TargetRespectiveValueConfig) Validate() (ValidTargetRespectiveValueConfig, error)
Validate validates the target respective value configuration
type TargetType ¶
type TargetType string
TargetType represents the type of the target service
const ( // TargetTypeHTTP represents the HTTP target service TargetTypeHTTP TargetType = "http" )
type ValidAuthAPIKeyConfig ¶
ValidAuthAPIKeyConfig represents the valid auth api key configuration
type ValidAuthBasicConfig ¶
ValidAuthBasicConfig represents the valid auth basic configuration
type ValidAuthConfig ¶
type ValidAuthConfig []ValidAuthRespectiveConfig
ValidAuthConfig represents the valid auth configuration
type ValidAuthCredentialConfig ¶
type ValidAuthCredentialConfig struct {
Store ValidStoreSpecifyConfig
}
ValidAuthCredentialConfig represents the valid auth credential configuration
type ValidAuthJWTConfig ¶
type ValidAuthJWTConfig struct {
Credential ValidAuthCredentialConfig
}
ValidAuthJWTConfig represents the valid auth jwt configuration
type ValidAuthOAuth2Config ¶
type ValidAuthOAuth2Config struct { GrantType AuthOAuth2GrantType ClientID string Scope []string ClientSecret string AccessType AuthOAuth2AccessType AuthURL string TokenURL string Username string Password string Credential ValidAuthCredentialConfig }
ValidAuthOAuth2Config represents the valid auth oauth2 configuration
type ValidAuthPrivateKeyConfig ¶
type ValidAuthPrivateKeyConfig struct {
PrivateKey string
}
ValidAuthPrivateKeyConfig represents the valid auth private key configuration
type ValidAuthRespectiveConfig ¶
type ValidAuthRespectiveConfig struct { ID string Default bool Type AuthType OAuth2 ValidAuthOAuth2Config APIKey ValidAuthAPIKeyConfig Basic ValidAuthBasicConfig PrivateKey ValidAuthPrivateKeyConfig JWT ValidAuthJWTConfig }
ValidAuthRespectiveConfig represents the valid auth configuration
type ValidClockConfig ¶
type ValidClockConfig struct { Format string Fake ValidFakeTimeConfig }
ValidClockConfig represents the valid clock configuration
type ValidConfig ¶
type ValidConfig struct { Type Type Env string Loader ValidLoaderConfig Targets ValidTargetConfig Outputs ValidOutputConfig Store ValidStoreConfig Encrypts ValidEncryptConfig Auth ValidAuthConfig Server ValidServerConfig Logging ValidLoggingConfig Clock ValidClockConfig Language ValidLanguageConfig Override ValidOverrideConfig SlaveSetting ValidSlaveSettingConfig }
ValidConfig represents the application configuration
type ValidConfigForOverride ¶
type ValidConfigForOverride struct { Env string `mapstructure:"env"` Override ValidOverrideConfig `mapstructure:"override"` }
ValidConfigForOverride represents the configuration for the override service
type ValidCredentialEncryptConfig ¶
ValidCredentialEncryptConfig represents the valid auth credential encrypt configuration
type ValidEncryptConfig ¶
type ValidEncryptConfig []ValidEncryptRespectiveConfig
ValidEncryptConfig represents the valid encrypt configuration
type ValidEncryptRespectiveConfig ¶
type ValidEncryptRespectiveConfig struct { ID string Type EncryptType Key []byte Store ValidStoreSpecifyConfig }
ValidEncryptRespectiveConfig represents the valid encrypt configuration
type ValidFakeTimeConfig ¶
ValidFakeTimeConfig represents the valid fake time configuration
type ValidLanguageConfig ¶
type ValidLanguageConfig struct {
Default LanguageType
}
ValidLanguageConfig represents the valid language configuration
type ValidLoaderConfig ¶
type ValidLoaderConfig struct {
BasePath string
}
ValidLoaderConfig represents the configuration for the loader service
type ValidLoggingConfig ¶
type ValidLoggingConfig struct {
Output []ValidLoggingOutputConfig
}
ValidLoggingConfig represents the valid configuration for logging
type ValidLoggingOutputConfig ¶
type ValidLoggingOutputConfig struct { Type LoggingOutputType Format LoggingOutputFormat Level LoggingOutputLevel Filename string Address string EnabledEnv struct { All bool Values []string } }
ValidLoggingOutputConfig represents the valid configuration for logging output
type ValidOutputConfig ¶
type ValidOutputConfig []ValidOutputRespectiveConfig
ValidOutputConfig represents the configuration for the output service
type ValidOutputRespectiveConfig ¶
type ValidOutputRespectiveConfig struct { ID string Values []ValidOutputRespectiveValueConfig }
ValidOutputRespectiveConfig represents the configuration for the output respective service
type ValidOutputRespectiveValueConfig ¶
type ValidOutputRespectiveValueConfig struct { Env string Type OutputType Format OutputFormat BasePath string }
ValidOutputRespectiveValueConfig represents the configuration for the output respective service value
type ValidOverrideConfig ¶
type ValidOverrideConfig []ValidOverrideRespectiveConfig
ValidOverrideConfig represents the configuration for the override service
type ValidOverrideRespectiveConfig ¶
type ValidOverrideRespectiveConfig struct { Type OverrideType FileType OverrideFileTypes Path string Partial bool Vars []ValidOverrideRespectiveVarConfig Key string Value string EnabledEnv struct { All bool Values []string } }
ValidOverrideRespectiveConfig represents the configuration for the override respective service
type ValidOverrideRespectiveVarConfig ¶
ValidOverrideRespectiveVarConfig represents the configuration for the override respective service var
type ValidServerConfig ¶
ValidServerConfig represents the valid server configuration
type ValidSlaveCertificateConfig ¶
ValidSlaveCertificateConfig represents the valid slave certificate configuration
type ValidSlaveSettingConfig ¶
type ValidSlaveSettingConfig struct { Port int Certificate ValidSlaveCertificateConfig Encrypt ValidCredentialEncryptConfig }
ValidSlaveSettingConfig represents the valid slave setting configuration
type ValidStoreConfig ¶
type ValidStoreConfig struct { File []ValidStoreFileConfig Buckets []string }
ValidStoreConfig represents the valid store configuration
type ValidStoreFileConfig ¶
ValidStoreFileConfig represents the valid file store configuration
type ValidStoreSpecifyConfig ¶
type ValidStoreSpecifyConfig struct { BucketID string Key string Encrypt ValidCredentialEncryptConfig }
ValidStoreSpecifyConfig represents the valid store configuration
type ValidTargetConfig ¶
type ValidTargetConfig []ValidTargetRespectiveConfig
ValidTargetConfig represents the configuration for the target service
type ValidTargetRespectiveConfig ¶
type ValidTargetRespectiveConfig struct { ID string Type TargetType Values []ValidTargetRespectiveValueConfig }
ValidTargetRespectiveConfig represents the configuration for the target respective service
type ValidTargetRespectiveValueConfig ¶
ValidTargetRespectiveValueConfig represents the configuration for the target respective service value