Documentation ¶
Index ¶
- func AddAutoscalingFlags(fs *pflag.FlagSet, value *cluster.Autoscaling)
- func AddBodyFlag(fs *pflag.FlagSet, value *string)
- func AddCCSFlags(fs *pflag.FlagSet, value *cluster.CCS)
- func AddCCSFlagsWithoutAccountID(fs *pflag.FlagSet, value *cluster.CCS)
- func AddClusterWideProxyFlags(fs *pflag.FlagSet, value *cluster.ClusterWideProxy)
- func AddDebugFlag(fs *pflag.FlagSet)
- func AddExistingVPCFlags(fs *pflag.FlagSet, value *cluster.ExistingVPC)
- func AddHeaderFlag(fs *pflag.FlagSet, values *[]string)
- func AddInteractiveFlag(flags *pflag.FlagSet, value *bool)
- func AddParameterFlag(fs *pflag.FlagSet, values *[]string)
- func AddProviderFlag(fs *pflag.FlagSet, value *string)
- func ApplyBodyFlag(request *sdk.Request, value string) error
- func ApplyHeaderFlag(request interface{}, values []string)
- func ApplyParameterFlag(request interface{}, values []string)
- func ApplyPathArg(request *sdk.Request, value string) error
- func CheckAutoscalingFlags(autoscaling cluster.Autoscaling, computeNodes int) error
- func CheckIgnoredCCSFlags(ccs cluster.CCS) error
- func CheckOneOf(fs *pflag.FlagSet, flagName string, options []Option) error
- func ParseNameValuePair(text string) (name, value string)
- func PromptBool(fs *pflag.FlagSet, flagName string) error
- func PromptFilePath(fs *pflag.FlagSet, flagName string) error
- func PromptIPNet(fs *pflag.FlagSet, flagName string) error
- func PromptInt(fs *pflag.FlagSet, flagName string, validate func() error) error
- func PromptOneOf(fs *pflag.FlagSet, flagName string, options []Option) error
- func PromptOrCheckOneOf(fs *pflag.FlagSet, flagName string, options []Option) error
- func PromptPassword(fs *pflag.FlagSet, flagName string) error
- func PromptString(fs *pflag.FlagSet, flagName string) error
- func SetQuestion(fs *pflag.FlagSet, flagName, question string)
- func Split(r rune) bool
- type CobraCompletionFunc
- type FilePath
- type Option
- type OptionsFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAutoscalingFlags ¶ added in v0.1.47
func AddAutoscalingFlags(fs *pflag.FlagSet, value *cluster.Autoscaling)
AddAutoscalingFlags adds the --enable-autoscaling --min-replicas and --max-replicas flags
func AddBodyFlag ¶
AddBodyFlag adds the '--body' flag to the given set of command line flags.
func AddCCSFlags ¶ added in v0.1.45
AddCCSFlags adds all the flags needed for creating a cluster.
func AddCCSFlagsWithoutAccountID ¶ added in v0.1.45
AddCCSFlagsWithoutAccountID is sufficient for list regions command.
func AddClusterWideProxyFlags ¶ added in v0.1.61
func AddClusterWideProxyFlags(fs *pflag.FlagSet, value *cluster.ClusterWideProxy)
func AddDebugFlag ¶
AddDebugFlag adds the '--debug' flag to the given set of command line flags.
func AddExistingVPCFlags ¶ added in v0.1.61
func AddExistingVPCFlags(fs *pflag.FlagSet, value *cluster.ExistingVPC)
func AddHeaderFlag ¶
AddHeaderFlag adds the '--header' flag to the given set of command line flags.
func AddInteractiveFlag ¶ added in v0.1.46
AddFlag adds the interactive flag to the given set of command line flags.
func AddParameterFlag ¶
AddParameterFlag adds the '--parameter' flag to the given set of command line flags.
func AddProviderFlag ¶ added in v0.1.45
func ApplyBodyFlag ¶
ApplyBodyFlag applies the value of the '--body' command line flag to the given request.
func ApplyHeaderFlag ¶
func ApplyHeaderFlag(request interface{}, values []string)
ApplyHeaderFlag applies the value of the '--header' command line flag to the given request.
func ApplyParameterFlag ¶
func ApplyParameterFlag(request interface{}, values []string)
ApplyParameterFlag applies the value of the '--parameter' command line flag to the given request.
func ApplyPathArg ¶
ApplyPathArg applies the value of the path given in the command line to the given request.
func CheckAutoscalingFlags ¶ added in v0.1.48
func CheckAutoscalingFlags(autoscaling cluster.Autoscaling, computeNodes int) error
CheckAutoscalingFlags errors if --min-replicas or --max-replicas were used without --enable-autoscaling (and vice-versa with --compute-nodes) It also errors if --min-replicas or --max-replicas were not supplied when --enable-autoscaling is used
func CheckIgnoredCCSFlags ¶ added in v0.1.45
CheckIgnoredCCSFlags errors if --aws-... were used without --ccs.
func CheckOneOf ¶ added in v0.1.46
CheckOneOf returns error if flag has been set and is not one of given options. It's appropriate for both optional flags (no error not given) and required flags (Cobra validated they're given before command .Run).
func ParseNameValuePair ¶ added in v0.1.50
ParseNameValuePair parses a name value pair.
func PromptBool ¶ added in v0.1.46
PromptBool sets a bool flag value interactively, unless already set. Does nothing in non-interactive mode.
func PromptFilePath ¶ added in v0.1.46
PromptFilePath sets a FilePath flag value interactively, unless already set. Does nothing in non-interactive mode.
func PromptIPNet ¶ added in v0.1.46
PromptIPNet sets an optional IPNet flag value interactively, unless already set. Does nothing in non-interactive mode.
func PromptInt ¶ added in v0.1.46
PromptInt sets an integer flag value interactively, unless already set. validation func is optional, and runs after the flag is already set. Does nothing in non-interactive mode. TODO: always validate, prompt if bad.
func PromptOneOf ¶ added in v0.1.46
PromptOneOf sets a string flag value interactively, from a set of valid options, unless already set.
func PromptOrCheckOneOf ¶ added in v0.1.46
PromptOrCheckOneOf uses a set of valid options for interactive prompt and/or validation. When flag is already set, validates it and doesn't prompt. TODO: prompt if bad. When not interactive, allows an optional flag to remain omitted.
func PromptPassword ¶ added in v0.1.46
PromptPassword sets a sensitive string flag value interactively, unless already set. Does nothing in non-interactive mode.
func PromptString ¶ added in v0.1.46
PromptString sets a string flag value interactively, unless already set. Does nothing in non-interactive mode.
func SetQuestion ¶ added in v0.1.46
SetQuestion sets a friendlier text to use when prompting instead of flag name.
Types ¶
type CobraCompletionFunc ¶ added in v0.1.46
type CobraCompletionFunc func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
CobraCompletionFunc is the signature cobra.RegisterFlagCompletionFunc() wants.
func MakeCompleteFunc ¶ added in v0.1.46
func MakeCompleteFunc(optionsFunc OptionsFunc) CobraCompletionFunc
type Option ¶ added in v0.1.46
type Option struct { Value string // Optional extra text to show (not always supported). Description string }
Option represents a value that can be used in interactive Select menu, or shell completion.
type OptionsFunc ¶ added in v0.1.46
type OptionsFunc func(connection *sdk.Connection) ([]Option, error)
OptionsFunc is a signature for functions generating arrays of values. They will be used both for interactive mode and flag completions.