Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cfg = &BaseConfig{}
Functions ¶
func LoadAppConfig ¶
func LoadAppConfig[T HasBaseConfig]( config T, serviceName, version string, defaults ...DefaultValue, ) error
Types ¶
type BaseConfig ¶
type BaseConfig struct {
HumanReadableOutput bool `mapstructure:"human_readable_output" validate:""`
LogLevel string `mapstructure:"log_level" validate:"oneof=debug info warn error"`
ProductionEnvironment bool `mapstructure:"production_environment" validate:""`
Port int `mapstructure:"port" validate:"numeric,min=1,max=65535"`
}
func (*BaseConfig) GetBase ¶
func (b *BaseConfig) GetBase() *BaseConfig
type ConfigError ¶ added in v0.6.1
func (ConfigError) Error ¶ added in v0.6.1
func (e ConfigError) Error() string
func (ConfigError) Unwrap ¶ added in v0.6.1
func (e ConfigError) Unwrap() error
type DefaultValue ¶ added in v0.6.1
type HasBaseConfig ¶
type HasBaseConfig interface {
GetBase() *BaseConfig
}
type ValidationError ¶ added in v0.6.1
type ValidationError struct {
Err validator.FieldError
}
func (ValidationError) Error ¶ added in v0.6.1
func (e ValidationError) Error() string
func (ValidationError) Unwrap ¶ added in v0.6.1
func (e ValidationError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.