Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func LoadConfig[T DefaultableAndValidatable](cfg T, configDir, configFileName string, defaultConfig []byte) error
LoadConfig takes a filepath relative to the config directory (usually just a filename) and tries to load the config from there. If the file doesn't exist, it takes the given defaults instead and also writes them to the config directory. After loading, the config is defaulted and then validated. Arguments: - cfg: The config struct to load the config into. Must be a pointer (will be passed into yaml.Unmarshal). - configDir: The directory where the config file is located. - configFileName: The name of the config file. - defaultConfig: The default config as []byte.
Types ¶
Click to show internal directories.
Click to hide internal directories.