Documentation
¶
Overview ¶
Package cfgm implements a configuration module.
Index ¶
Constants ¶
View Source
const ( DisabledValue = "<disabled>" DefaultValue = "<default>" )
Common sentinel values.
Variables ¶
This section is empty.
Functions ¶
func NewInitializer ¶
func NewInitializer[T Config](cfgLoader ConfigLoader[T]) injectz.Initializer
NewInitializer returns a injectz.Initializer that uses the given ConfigLoader.
func NewSingletonInjector ¶
NewSingletonInjector injects.
Types ¶
type ConfigLoader ¶
ConfigLoader describes a function that can load a Config, for example from environment variables or JSON file.
func MustNewEnvConfigLoader ¶
func MustNewEnvConfigLoader[T Config](options *EnvConfigLoaderOptions, enableValidation bool) ConfigLoader[T]
MustNewEnvConfigLoader returns a ConfigLoader that loads the config from environment variables. Under the hood it uses "github.com/caarlos0/env/v11". T must be a struct pointer.
type EnvConfigLoaderOptions ¶
type EnvConfigLoaderOptions = env.Options
EnvConfigLoaderOptions describes the options for MustNewEnvConfigLoader.
Click to show internal directories.
Click to hide internal directories.