{"modulePath":"github.com/181192/ops-cli","version":"v0.1.20","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cmdutils\n\n## Constants\n\n```go\nconst IncompatibleFlags = \"cannot be used at the same time\"\n```\nIncompatibleFlags is a common substring of an error message\n\n## Functions\n\n```go\nfunc AddClusterFlag(fs *pflag.FlagSet, clusterConfig *api.ClusterConfig)\n```\nAddClusterFlag adds a common --cluster flag for cluster name. Use this for commands whose principal resource is \\*not\\* a cluster.\n\n```go\nfunc AddCommonFlagsForFlux(fs *pflag.FlagSet, opts *InstallOpts)\n```\nAddCommonFlagsForFlux configures the flags required to install Flux on a cluster and have it point to the specified Git repository.\n\n```go\nfunc AddCommonFlagsForGit(fs *pflag.FlagSet, opts *git.Options)\n```\nAddCommonFlagsForGit configures the flags required to interact with a Git repository.\n\n```go\nfunc AddCommonFlagsForKubeconfig(fs *pflag.FlagSet, outputPath, authenticatorRoleARN *string, setContext, autoPath *bool, exampleName string)\n```\nAddCommonFlagsForKubeconfig adds common flags for controlling how output kubeconfig is written\n\n```go\nfunc AddCommonFlagsForKubernetes(fs *pflag.FlagSet, opts *KubernetesOpts, defaultNamespace string)\n```\nAddCommonFlagsForKubernetes configures the flags required to interact with Kubernetes cluster\n\n```go\nfunc AddCommonFlagsForProfile(fs *pflag.FlagSet, opts *profile.Options)\n```\nAddCommonFlagsForProfile configures the flags required to enable a profile.\n\n```go\nfunc AddConfigFileFlag(fs *pflag.FlagSet, path *string)\n```\nAddConfigFileFlag adds common --config-file flag\n\n```go\nfunc AddLoadBalancerIPFlag(fs *pflag.FlagSet, clusterConfig *api.ClusterConfig)\n```\nAddLoadBalancerIPFlag adds a common --load-balancer-ip flag for load balancer ip.\n\n```go\nfunc AddLoadBalancerResourceGroupFlag(fs *pflag.FlagSet, clusterConfig *api.ClusterConfig)\n```\nAddLoadBalancerResourceGroupFlag adds a common --load-balancer-ip-rg flag for load balancer ip resource group.\n\n```go\nfunc AddLocationFlag(fs *pflag.FlagSet, p *api.ClusterConfig)\n```\nAddLocationFlag adds common --location flag\n\n```go\nfunc AddResourceCmd(flagGrouping *FlagGrouping, parentVerbCmd *cobra.Command, newCmd func(*Cmd))\n```\nAddResourceCmd create a registers a new command under the given verb command\n\n```go\nfunc AddVersionFlag(fs *pflag.FlagSet, meta *api.ClusterConfig, extraUsageInfo string)\n```\nAddVersionFlag adds common --version flag\n\n```go\nfunc AddWaitFlag(fs *pflag.FlagSet, wait *bool, description string)\n```\nAddWaitFlag adds common --wait flag\n\n```go\nfunc AddWaitFlagWithFullDescription(fs *pflag.FlagSet, wait *bool, description string)\n```\nAddWaitFlagWithFullDescription adds common --wait flag\n\n```go\nfunc ClusterNameFlag(cmd *Cmd) string\n```\nClusterNameFlag returns the flag to use for the cluster name taking the principal resource into account.\n\n```go\nfunc ErrCannotUseWithConfigFile(what string) error\n```\nErrCannotUseWithConfigFile is a common error message\n\n```go\nfunc ErrClusterFlagAndArg(cmd *Cmd, nameFlag, nameArg string) error\n```\nErrClusterFlagAndArg wraps ErrFlagAndArg() by passing in the proper flag name.\n\n```go\nfunc ErrFlagAndArg(kind, flag, arg string) error\n```\nErrFlagAndArg may be used to err for options that can be given as flags /and/ arg but only one is allowed to be used.\n\n```go\nfunc ErrMustBeSet(pathOrFlag string) error\n```\nErrMustBeSet is a common error message\n\n```go\nfunc ErrUnsupportedNameArg() error\n```\nErrUnsupportedNameArg reports unsupported usage of \\`name\\` argument\n\n```go\nfunc GetNameArg(args []string) string\n```\nGetNameArg tests to ensure there is only 1 name argument\n\n```go\nfunc LoadConfigFromFile(configFile string) (*api.ClusterConfig, error)\n```\nLoadConfigFromFile loads ClusterConfig from configFile\n\n```go\nfunc ValidateGitOptions(opts *git.Options) error\n```\nValidateGitOptions validates the provided Git options.\n\n## Types\n\n```go\ntype ClusterConfigLoader interface {\n\tLoad() error\n}\n```\nClusterConfigLoader is an interface that loaders should implement\n\n```go\nfunc NewGitOpsConfigLoader(cmd *Cmd) ClusterConfigLoader\n```\nNewGitOpsConfigLoader creates a new ClusterConfigLoader which handles loading of ClusterConfigFile v.s. using CLI flags for GitOps-related commands.\n\n```go\nfunc NewMetadataLoader(cmd *Cmd) ClusterConfigLoader\n```\nNewMetadataLoader handles loading of clusterConfigFile vs using flags for all commands that require only metadata fields, e.g. \\`eksctl delete cluster\\` or \\`eksctl utils update-kube-proxy\\` and other similar commands that do simple operations against existing clusters\n\n```go\ntype Cmd struct {\n\tCobraCommand *cobra.Command\n\tFlagSetGroup *NamedFlagSetGroup\n\n\tValidate bool\n\n\tNameArg           string\n\tClusterConfigFile string\n\n\tClusterConfig *api.ClusterConfig\n}\n```\nCmd hold common attributes between commands\n\n```go\nfunc (c *Cmd) NewCtl() error\n```\nNewCtl validates\n\n```go\ntype FlagGrouping struct {\n\t// contains filtered or unexported fields\n}\n```\nFlagGrouping holds a superset of all flagsets for all commands\n\n```go\nfunc NewGrouping() *FlagGrouping\n```\nNewGrouping creates an instance of Grouping\n\n```go\nfunc (g *FlagGrouping) New(cmd *cobra.Command) *NamedFlagSetGroup\n```\nNew creates a new group of flagsets for use with a subcommand\n\n```go\nfunc (g *FlagGrouping) Usage(cmd *cobra.Command) error\n```\nUsage is for use with (\\*cobra.Command).SetUsageFunc\n\n```go\ntype InstallOpts struct {\n\tGitOptions               git.Options\n\tGitPaths                 []string\n\tGitLabel                 string\n\tGitFluxPath              string\n\tWithHelm                 bool\n\tHelmVersions             []string\n\tManifestGeneration       bool\n\tGarbageCollection        bool\n\tAcrRegistry              bool\n\tOverrideValues           bool\n\tFluxChartVersion         string\n\tHelmOperatorChartVersion string\n\tSkipInstall              bool\n\tKubernetesOpts           KubernetesOpts\n}\n```\nInstallOpts are the installation options for Flux\n\n```go\ntype KubernetesOpts struct {\n\tKubeConfig  string\n\tKubeContext string\n\tNamespace   string\n}\n```\nKubernetesOpts common kubernetes opts\n\n```go\ntype NamedFlagSetGroup struct {\n\t// contains filtered or unexported fields\n}\n```\nNamedFlagSetGroup holds a single group of flagsets\n\n```go\nfunc (n *NamedFlagSetGroup) AddTo(cmd *cobra.Command)\n```\nAddTo mixes all flagsets in the given group into another flagset\n\n```go\nfunc (n *NamedFlagSetGroup) InFlagSet(name string, cb func(*pflag.FlagSet))\n```\nInFlagSet returns new or existing named FlagSet in a group\n\n","path":"github.com/181192/ops-cli/pkg/cmd/cmdutils","name":"cmdutils","synopsis":"","isRedistributable":true}
