Documentation ¶
Index ¶
- func FieldValidation(config any, fieldValidator map[string]func(any) error) error
- func GenerateDotEnvFromConfig(serviceName, filePath string, config WithValidation) error
- func GenericNumberLowerOrEmptyValidator[T NumberTypeGeneric]() func(any) error
- func GenericStringNotEmptyValidator[T ~string]() func(any) error
- func GetConfigField[T WithValidation](config WithValidation, fieldValueMatchers ...func(T) bool) (T, error)
- func LoadConfig(configStruct WithValidation, nodePath string, loadOptions ...Option) error
- func ValidationValidator() func(any) error
- type NumberTypeGeneric
- type Option
- type WithValidation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldValidation ¶
func GenerateDotEnvFromConfig ¶
func GenerateDotEnvFromConfig(serviceName, filePath string, config WithValidation) error
func GenericNumberLowerOrEmptyValidator ¶
func GenericNumberLowerOrEmptyValidator[T NumberTypeGeneric]() func(any) error
func GetConfigField ¶
func GetConfigField[T WithValidation]( config WithValidation, fieldValueMatchers ...func(T) bool, ) (T, error)
func LoadConfig ¶
func LoadConfig(configStruct WithValidation, nodePath string, loadOptions ...Option) error
func ValidationValidator ¶
Types ¶
type NumberTypeGeneric ¶
type Option ¶
type Option struct { Provider koanf.Provider Parser koanf.Parser UnmarshalConf koanf.UnmarshalConf }
func WithEnvLoadOption ¶
func WithJSONLoadOption ¶
type WithValidation ¶
type WithValidation interface {
ValidateConfigFields() error
}
Click to show internal directories.
Click to hide internal directories.