config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(value any, t reflect.Type) (reflect.Value, Error)

Convert returns a reflect.Value from an "any" value cast according to a reflect.Type

func ConvertNumeric

func ConvertNumeric[T2, T1 IntegerConstraint | FloatConstraint](value T1) T2

func ConvertNumericString

func ConvertNumericString[T IntegerConstraint | FloatConstraint](value T) string

func ConvertStringNumeric

func ConvertStringNumeric[T IntegerConstraint | FloatConstraint](value string) (T, Error)

func Validate

func Validate(obj any) Error

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

TODO: Define configurable ConfigLoader !!!

func NewConfigFor

func NewConfigFor(m map[string]any) *Config

func (*Config) ActiveProfiles

func (this *Config) ActiveProfiles() []string

func (*Config) AddConfigFS

func (this *Config) AddConfigFS(fsys fs.FS) Error

func (*Config) AddDefaultConfigFS

func (this *Config) AddDefaultConfigFS(fsys fs.FS) Error

func (*Config) AddOverride

func (this *Config) AddOverride(key, value string) Error

func (*Config) CopyDefaultConfig

func (this *Config) CopyDefaultConfig(from, to string) Error

func (*Config) CopyDefaultConfigForProfile

func (this *Config) CopyDefaultConfigForProfile(from, to, profile string) Error

func (*Config) GetConfigValue

func (this *Config) GetConfigValue(key string) (string, Error)

func (*Config) GetSubConfig

func (this *Config) GetSubConfig(key string) (*Config, Error)

func (*Config) InitConfig

func (this *Config) InitConfig() Error

func (*Config) LoadConfig

func (this *Config) LoadConfig(config map[string]any) Error

func (*Config) LoadConfigAt

func (this *Config) LoadConfigAt(config map[string]any, root string) Error

func (*Config) LoadConfigForProfile

func (this *Config) LoadConfigForProfile(config map[string]any, profile string) Error

func (*Config) LoadConfigForProfileAt

func (this *Config) LoadConfigForProfileAt(config map[string]any, profile, root string) Error

func (*Config) LoadDefaultConfig

func (this *Config) LoadDefaultConfig(config map[string]any) Error

func (*Config) LoadDefaultConfigAt

func (this *Config) LoadDefaultConfigAt(config map[string]any, root string) Error

func (*Config) Reset

func (this *Config) Reset()

func (*Config) SetActiveProfiles

func (this *Config) SetActiveProfiles(profiles []string) Error

func (*Config) Unmarshal

func (this *Config) Unmarshal(obj any) Error

type InvalidTypeKeyError

type InvalidTypeKeyError struct {
	*DefaultError
}

func NewInvalidTypeKeyError

func NewInvalidTypeKeyError(key, component string) *InvalidTypeKeyError

type KeyNotFoundError

type KeyNotFoundError struct {
	*DefaultError
}

func NewKeyNotFoundError

func NewKeyNotFoundError(key, component string) *KeyNotFoundError

type YamlConfigFSLoader

type YamlConfigFSLoader struct{}

func (*YamlConfigFSLoader) ParseConfigurationFilesystem

func (this *YamlConfigFSLoader) ParseConfigurationFilesystem(fsys fs.FS, loader func(m map[string]any, profile string))

Jump to

Keyboard shortcuts

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