config

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopulateAppConfig added in v0.9.0

func PopulateAppConfig[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

type ConfigError struct {
	Msg string
	Err error
}

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 DefaultValue struct {
	Key   string
	Value any
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL