Documentation
¶
Index ¶
- Variables
- func AddBoolFlag(command *cobra.Command, key, flagName, flagShorthand string, defaultValue bool, ...)
- func AddDefaultFlags(command *cobra.Command, envPrefix string)
- func AddDurationFlag(command *cobra.Command, key, flagName, flagShorthand string, ...)
- func AddStringFlag(command *cobra.Command, ...)
- func ReadConfig(viper *vp.Viper, cfg config.Base, defaultConfigDir string) error
Constants ¶
This section is empty.
Variables ¶
var Version = &cobra.Command{ Use: "version", Short: "Print the Aptomi Client version", Run: func(cmd *cobra.Command, args []string) { info := version.GetBuildInfo() fmt.Printf("Aptomi Client version: %s\n git commit: %s\n built: %s\n", info.GitVersion, info.GitCommit, info.BuildDate) }, }
Version is the instance of cobra command that shows version from version package (injected at build tome)
Functions ¶
func AddBoolFlag ¶
func AddBoolFlag(command *cobra.Command, key, flagName, flagShorthand string, defaultValue bool, env, usage string)
AddBoolFlag adds bool flag to provided cobra command and registers with provided env variable name
func AddDefaultFlags ¶
AddDefaultFlags add all the flags that are needed by any aptomi CLI
func AddDurationFlag ¶
func AddDurationFlag(command *cobra.Command, key, flagName, flagShorthand string, defaultValue time.Duration, env, usage string)
AddDurationFlag adds duration flag to provided cobra command and registers with provided env variable name
func AddStringFlag ¶
func AddStringFlag(command *cobra.Command, key, flagName, flagShorthand, defaultValue, env, usage string)
AddStringFlag adds string flag to provided cobra command and registers with provided env variable name
func ReadConfig ¶
ReadConfig reads configuration from CLI flags, default or specified file path into provided config object using the provided Viper instance and default configuration directory. It'll be checking if --config provided first and there are supported config file types in it if it's directory.
Types ¶
This section is empty.