Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindEnvVarsToFlags ¶
func BindEnvVarsToFlags( viperObj *viper.Viper, cmd *cobra.Command, envPrefix string, logger *logr.Logger, )
Init the config reader via Viper and Cobra objects. we can specify either the config file name, or the config name, and its type as well as the locations to find that config files
func GenerateFlags ¶
GenerateFlags creates flags based on the attributes of object `value` and bind them to viper this function should be called when initialize cobra command return error in case these is any issue when generating flags for CLI
func InitConfigReader ¶
func InitConfigReader( viperObj *viper.Viper, cmd *cobra.Command, cfgFile string, cfgName string, cfgType string, configLocations []string, envPrefix string, logger *logr.Logger, autoBindEnvVarsToFlags bool, ) error
Init the config reader via Viper and Cobra objects. we can specify either the config file name, or the config name, and its type as well as the locations to find that config files if autoBindEnvVarsToFlags is true, the environment variables are bind automatically to the pflags name of the env vars is based on the struct
Types ¶
This section is empty.