Documentation
¶
Overview ¶
Package config contains the configuration for the minder cli and server
Index ¶
- func BindConfigFlag[V any](v *viper.Viper, flags *pflag.FlagSet, viperPath string, cmdLineArg string, ...) error
- func BindConfigFlagWithShort[V any](v *viper.Viper, flags *pflag.FlagSet, viperPath string, cmdLineArg string, ...) error
- func GetConfigFileData(cfgFile, defaultCfgPath string) (interface{}, error)
- func GetKeysWithNullValueFromYAML(data interface{}, currentPath string) []string
- type FlagInst
- type FlagInstShort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindConfigFlag ¶ added in v0.0.22
func BindConfigFlag[V any]( v *viper.Viper, flags *pflag.FlagSet, viperPath string, cmdLineArg string, defaultValue V, help string, binder FlagInst[V], ) error
BindConfigFlag is a helper function that binds a configuration value to a flag.
Parameters: - v: The viper.Viper object used to retrieve the configuration value. - flags: The pflag.FlagSet object used to retrieve the flag value. - viperPath: The path used to retrieve the configuration value from Viper. - cmdLineArg: The flag name used to check if the flag has been set and to retrieve its value. - help: The help text for the flag. - defaultValue: A default value used to determine the type of the flag (string, int, etc.). - binder: A function that creates a flag and returns a pointer to the value.
func BindConfigFlagWithShort ¶ added in v0.0.22
func BindConfigFlagWithShort[V any]( v *viper.Viper, flags *pflag.FlagSet, viperPath string, cmdLineArg string, short string, defaultValue V, help string, binder FlagInstShort[V], ) error
BindConfigFlagWithShort is a helper function that binds a configuration value to a flag.
Parameters: - v: The viper.Viper object used to retrieve the configuration value. - flags: The pflag.FlagSet object used to retrieve the flag value. - viperPath: The path used to retrieve the configuration value from Viper. - cmdLineArg: The flag name used to check if the flag has been set and to retrieve its value. - short: The short name for the flag. - help: The help text for the flag. - defaultValue: A default value used to determine the type of the flag (string, int, etc.). - binder: A function that creates a flag and returns a pointer to the value.
func GetConfigFileData ¶ added in v0.0.24
GetConfigFileData returns the data from the given configuration file.
func GetKeysWithNullValueFromYAML ¶ added in v0.0.24
GetKeysWithNullValueFromYAML returns a list of paths to null values in the given configuration data.
Types ¶
type FlagInst ¶ added in v0.0.22
FlagInst is a function that creates a flag and returns a pointer to the value
type FlagInstShort ¶ added in v0.0.22
FlagInstShort is a function that creates a flag and returns a pointer to the value
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client contains the configuration for the minder cli
|
Package client contains the configuration for the minder cli |
|
Package server contains a centralized structure for all configuration options.
|
Package server contains a centralized structure for all configuration options. |