Documentation ¶
Index ¶
- Constants
- Variables
- func EmailConfigStructLevelValidation(sl validator.StructLevel)
- func IsValidUrl(input string) bool
- func PrintFields(data any, ignoredKeys ...string)
- func ValidateConfig[T any](c T) error
- type EmailConfig
- func (conf *EmailConfig) GetFrom() (string, error)
- func (conf *EmailConfig) GetPassword() (string, error)
- func (conf *EmailConfig) GetTo() ([]string, error)
- func (conf *EmailConfig) GetUsername() (string, error)
- func (conf *EmailConfig) IsConfigured() bool
- func (e *EmailConfig) String() string
- func (conf *EmailConfig) Validate() error
- type HttpConfig
- type MqttConfig
- type SqsConfig
- type VaultAuthStrategy
- type VaultConfig
Constants ¶
View Source
const ( AddrFamilyIpv6 = "ip6" AddrFamilyIpv4 = "ip4" )
Variables ¶
View Source
var SensitiveFields = []string{"KeyPair", "SmtpPassword"}
Functions ¶
func EmailConfigStructLevelValidation ¶ added in v1.21.1
func EmailConfigStructLevelValidation(sl validator.StructLevel)
func IsValidUrl ¶
func PrintFields ¶
func ValidateConfig ¶
Types ¶
type EmailConfig ¶
type EmailConfig struct { From string `yaml:"from" env:"EMAIL_FROM" validate:"omitempty,email"` FromFile string `yaml:"from_file" env:"EMAIL_FROM_FILE" validate:"omitempty,filepath"` To []string `yaml:"to" env:"EMAIL_TO" envSeparator:";" validate:"omitempty,dive,email"` ToFile string `yaml:"to_file" env:"EMAIL_TO" validate:"omitempty,filepath"` SmtpHost string `yaml:"host" env:"EMAIL_HOST" validate:"omitempty,hostname"` SmtpPort int `yaml:"port" env:"EMAIL_PORT" validate:"omitempty,gte=25,lte=65535"` SmtpUsername string `yaml:"user" env:"EMAIL_USER"` SmtpUsernameFile string `yaml:"user_file" env:"EMAIL_USER_FILE" validate:"omitempty,filepath"` SmtpPassword string `yaml:"password" env:"EMAIL_PASSWORD"` SmtpPasswordFile string `yaml:"password_file" env:"EMAIL_PASSWORD_FILE" validate:"omitempty,filepath"` }
func (*EmailConfig) GetFrom ¶
func (conf *EmailConfig) GetFrom() (string, error)
func (*EmailConfig) GetPassword ¶
func (conf *EmailConfig) GetPassword() (string, error)
func (*EmailConfig) GetTo ¶
func (conf *EmailConfig) GetTo() ([]string, error)
func (*EmailConfig) GetUsername ¶
func (conf *EmailConfig) GetUsername() (string, error)
func (*EmailConfig) IsConfigured ¶
func (conf *EmailConfig) IsConfigured() bool
func (*EmailConfig) String ¶ added in v1.21.1
func (e *EmailConfig) String() string
func (*EmailConfig) Validate ¶
func (conf *EmailConfig) Validate() error
type HttpConfig ¶
type MqttConfig ¶
type MqttConfig struct { Brokers []string `yaml:"brokers" env:"BROKERS" envSeparator:";" validate:"broker"` ClientId string `yaml:"client_id" env:"CLIENT_ID" validate:"required_with=Brokers ''"` CaCertFile string `yaml:"tls_ca_cert" env:"TLS_CA" validate:"omitempty,file"` ClientCertFile string `yaml:"tls_client_cert" env:"TLS_CERT" validate:"omitempty,required_unless=ClientKeyFile '',file"` ClientKeyFile string `yaml:"tls_client_key" env:"TLS_KEY" validate:"omitempty,required_unless=ClientCertFile '',file"` TlsInsecure bool `yaml:"tls_insecure" env:"TLS_INSECURE"` }
func (*MqttConfig) TlsConfig ¶
func (conf *MqttConfig) TlsConfig() *tls.Config
func (*MqttConfig) UsesTlsClientCerts ¶
func (conf *MqttConfig) UsesTlsClientCerts() bool
type SqsConfig ¶
type SqsConfig struct { SqsQueue string `yaml:"sqs_queue" env:"SQS_QUEUE"` Region string `yaml:"region" env:"SQS_REGION"` }
func DefaultSqsConfig ¶
func DefaultSqsConfig() SqsConfig
type VaultAuthStrategy ¶
type VaultAuthStrategy string
var ( VaultAuthStrategyToken VaultAuthStrategy = "token" VaultAuthStrategyApprole VaultAuthStrategy = "approle" VaultAuthStrategyKubernetes VaultAuthStrategy = "kubernetes" )
type VaultConfig ¶
type VaultConfig struct { VaultAddr string `yaml:"vault_addr,omitempty" env:"VAULT_ADDR" validate:"required_unless=AuthStrategy ''"` AuthStrategy VaultAuthStrategy `yaml:"vault_auth_strategy" env:"VAULT_AUTH_STRATEGY" validate:"omitempty,oneof=token approle kubernetes"` AwsRoleName string `yaml:"vault_aws_role_name,omitempty" env:"VAULT_AWS_ROLE_NAME"` AwsMountPath string `yaml:"vault_aws_mount_path,omitempty" env:"VAULT_AWS_MOUNT"` AppRoleId string `yaml:"vault_app_role_id,omitempty" env:"VAULT_APPROLE_ROLE_ID"` AppRoleSecretId string `yaml:"vault_app_role_secret,omitempty" env:"VAULT_APPROLE_SECRET_ID"` VaultToken string `yaml:"vault_token,omitempty" env:"VAULT_TOKEN"` }
func GetDefaultVaultConfig ¶
func GetDefaultVaultConfig() VaultConfig
func (*VaultConfig) UseVaultCredentialsProvider ¶
func (c *VaultConfig) UseVaultCredentialsProvider() bool
Click to show internal directories.
Click to hide internal directories.