Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SetupFlagsConfig ¶ added in v0.2.23
type SetupFlagsConfig struct {
DisableWriteConfigFlag bool
}
SetupFlagsConfig contains options to enable or disable certain flags from being added.
type SetupViperConfig ¶ added in v0.2.23
type SetupViperConfig struct { }
SetupViperConfig options ot pass to SetupViper.
type ViperSetup ¶
type ViperSetup struct {
// contains filtered or unexported fields
}
ViperSetup stores config requires to fully setup an aduu app.
func SetupViper ¶
func SetupViper(appName string, req *SetupViperConfig) (setup *ViperSetup, v *viper.Viper)
SetupViper sets up viper for immediate use.
func (*ViperSetup) IsWriteConfigSet ¶
func (setup *ViperSetup) IsWriteConfigSet() bool
IsWriteConfigSet return whether the config write flag was set.
func (*ViperSetup) SetupFlags ¶ added in v0.2.23
func (setup *ViperSetup) SetupFlags( cmd *cobra.Command, flagsConfig *SetupFlagsConfig, )
SetupFlags adds klog flags to the given command together with a -w flag. The -w flag enables saving the current viper state to the default config file.
func (*ViperSetup) WriteConfig ¶
func (setup *ViperSetup) WriteConfig() (err error)
Click to show internal directories.
Click to hide internal directories.