{"modulePath":"github.com/UnityTech/client-go","version":"v11.0.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package clientcmd\n\nPackage clientcmd provides one stop shopping for building a working client from a fixed config, from a .kubeconfig file, from command line flags, or from any merged combination.\n\nSample usage from merged .kubeconfig files (local directory, home directory)\n\n\tloadingRules := clientcmd.NewDefaultClientConfigLoadingRules()\n\t// if you want to change the loading rules (which files in which order), you can do so here\n\n\tconfigOverrides := \u0026clientcmd.ConfigOverrides{}\n\t// if you want to change override values or bind them to flags, there are methods to help you\n\n\tkubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides)\n\tconfig, err := kubeConfig.ClientConfig()\n\tif err != nil {\n\t\t// Do something\n\t}\n\tclient, err := metav1.New(config)\n\t// ...\n\n## Constants\n\n```go\nconst (\n\tRecommendedConfigPathFlag   = \"kubeconfig\"\n\tRecommendedConfigPathEnvVar = \"KUBECONFIG\"\n\tRecommendedHomeDir          = \".kube\"\n\tRecommendedFileName         = \"config\"\n\tRecommendedSchemaName       = \"schema\"\n)\n```\n\n```go\nconst (\n\tFlagClusterName      = \"cluster\"\n\tFlagAuthInfoName     = \"user\"\n\tFlagContext          = \"context\"\n\tFlagNamespace        = \"namespace\"\n\tFlagAPIServer        = \"server\"\n\tFlagInsecure         = \"insecure-skip-tls-verify\"\n\tFlagCertFile         = \"client-certificate\"\n\tFlagKeyFile          = \"client-key\"\n\tFlagCAFile           = \"certificate-authority\"\n\tFlagEmbedCerts       = \"embed-certs\"\n\tFlagBearerToken      = \"token\"\n\tFlagImpersonate      = \"as\"\n\tFlagImpersonateGroup = \"as-group\"\n\tFlagUsername         = \"username\"\n\tFlagPassword         = \"password\"\n\tFlagTimeout          = \"request-timeout\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\t// ClusterDefaults has the same behavior as the old EnvVar and DefaultCluster fields\n\t// DEPRECATED will be replaced\n\tClusterDefaults = clientcmdapi.Cluster{Server: getDefaultServer()}\n\t// DefaultClientConfig represents the legacy behavior of this package for defaulting\n\t// DEPRECATED will be replace\n\tDefaultClientConfig = DirectClientConfig{*clientcmdapi.NewConfig(), \"\", \u0026ConfigOverrides{\n\t\tClusterDefaults: ClusterDefaults,\n\t}, nil, NewDefaultClientConfigLoadingRules(), promptedCredentials{}}\n)\n```\n\n```go\nvar (\n\tRecommendedConfigDir  = path.Join(homedir.HomeDir(), RecommendedHomeDir)\n\tRecommendedHomeFile   = path.Join(RecommendedConfigDir, RecommendedFileName)\n\tRecommendedSchemaFile = path.Join(RecommendedConfigDir, RecommendedSchemaName)\n)\n```\n\n```go\nvar (\n\tErrNoContext   = errors.New(\"no context chosen\")\n\tErrEmptyConfig = errors.New(\"no configuration has been provided\")\n\t// message is for consistency with old behavior\n\tErrEmptyCluster = errors.New(\"cluster has no server defined\")\n)\n```\n\n## Functions\n\n```go\nfunc BindAuthInfoFlags(authInfo *clientcmdapi.AuthInfo, flags *pflag.FlagSet, flagNames AuthOverrideFlags)\n```\nBindAuthInfoFlags is a convenience method to bind the specified flags to their associated variables\n\n```go\nfunc BindClusterFlags(clusterInfo *clientcmdapi.Cluster, flags *pflag.FlagSet, flagNames ClusterOverrideFlags)\n```\nBindClusterFlags is a convenience method to bind the specified flags to their associated variables\n\n```go\nfunc BindContextFlags(contextInfo *clientcmdapi.Context, flags *pflag.FlagSet, flagNames ContextOverrideFlags)\n```\nBindFlags is a convenience method to bind the specified flags to their associated variables\n\n```go\nfunc BindOverrideFlags(overrides *ConfigOverrides, flags *pflag.FlagSet, flagNames ConfigOverrideFlags)\n```\nBindOverrideFlags is a convenience method to bind the specified flags to their associated variables\n\n```go\nfunc BuildConfigFromFlags(masterUrl, kubeconfigPath string) (*restclient.Config, error)\n```\nBuildConfigFromFlags is a helper function that builds configs from a master url or a kubeconfig filepath. These are passed in as command line flags for cluster components. Warnings should reflect this usage. If neither masterUrl or kubeconfigPath are passed in we fallback to inClusterConfig. If inClusterConfig fails, we fallback to the default config.\n\n```go\nfunc BuildConfigFromKubeconfigGetter(masterUrl string, kubeconfigGetter KubeconfigGetter) (*restclient.Config, error)\n```\nBuildConfigFromKubeconfigGetter is a helper function that builds configs from a master url and a kubeconfigGetter.\n\n```go\nfunc ConfirmUsable(config clientcmdapi.Config, passedContextName string) error\n```\nConfirmUsable looks a particular context and determines if that particular part of the config is useable.  There might still be errors in the config, but no errors in the sections requested or referenced.  It does not return early so that it can find as many errors as possible.\n\n```go\nfunc GetAuthInfoFileReferences(authInfo *clientcmdapi.AuthInfo) []*string\n```\n\n```go\nfunc GetClusterFileReferences(cluster *clientcmdapi.Cluster) []*string\n```\n\n```go\nfunc GetConfigFileReferences(config *clientcmdapi.Config) []*string\n```\n\n```go\nfunc GetConfigFromFileOrDie(filename string) *clientcmdapi.Config\n```\nGetConfigFromFileOrDie tries to read a kubeconfig file and if it can't, it calls exit.  One exception, missing files result in empty configs, not an exit\n\n```go\nfunc IsConfigurationInvalid(err error) bool\n```\nIsConfigurationInvalid returns true if the provided error indicates the configuration is invalid.\n\n```go\nfunc IsContextNotFound(err error) bool\n```\nIsContextNotFound returns a boolean indicating whether the error is known to report that a context was not found\n\n```go\nfunc IsEmptyConfig(err error) bool\n```\nIsEmptyConfig returns true if the provided error indicates the provided configuration is empty.\n\n```go\nfunc Load(data []byte) (*clientcmdapi.Config, error)\n```\nLoad takes a byte slice and deserializes the contents into Config object. Encapsulates deserialization without assuming the source is a file.\n\n```go\nfunc LoadFromFile(filename string) (*clientcmdapi.Config, error)\n```\nLoadFromFile takes a filename and deserializes the contents into Config object\n\n```go\nfunc MakeRelative(path, base string) (string, error)\n```\n\n```go\nfunc ModifyConfig(configAccess ConfigAccess, newConfig clientcmdapi.Config, relativizePaths bool) error\n```\nModifyConfig takes a Config object, iterates through Clusters, AuthInfos, and Contexts, uses the LocationOfOrigin if specified or uses the default destination file to write the results into.  This results in multiple file reads, but it's very easy to follow. Preferences and CurrentContext should always be set in the default destination file.  Since we can't distinguish between empty and missing values (no nil strings), we're forced have separate handling for them.  In the kubeconfig cases, newConfig should have at most one difference, that means that this code will only write into a single file.  If you want to relativizePaths, you must provide a fully qualified path in any modified element.\n\n```go\nfunc ParseTimeout(duration string) (time.Duration, error)\n```\nParseTimeout returns a parsed duration from a string A duration string value must be a positive integer, optionally followed by a corresponding time unit (s|m|h).\n\n```go\nfunc PersisterForUser(configAccess ConfigAccess, user string) restclient.AuthProviderConfigPersister\n```\n\n```go\nfunc RESTConfigFromKubeConfig(configBytes []byte) (*restclient.Config, error)\n```\nRESTConfigFromKubeConfig is a convenience method to give back a restconfig from your kubeconfig bytes. For programmatic access, this is what you want 80% of the time\n\n```go\nfunc RelativizeAuthInfoLocalPaths(authInfo *clientcmdapi.AuthInfo) error\n```\nRelativizeAuthInfoLocalPaths first absolutizes the paths by calling ResolveLocalPaths.  This assumes that any NEW path is already absolute, but any existing path will be resolved relative to LocationOfOrigin\n\n```go\nfunc RelativizeClusterLocalPaths(cluster *clientcmdapi.Cluster) error\n```\nRelativizeClusterLocalPaths first absolutizes the paths by calling ResolveLocalPaths.  This assumes that any NEW path is already absolute, but any existing path will be resolved relative to LocationOfOrigin\n\n```go\nfunc RelativizeConfigPaths(config *clientcmdapi.Config, base string) error\n```\n\n```go\nfunc RelativizePathWithNoBacksteps(refs []*string, base string) error\n```\nRelativizePathWithNoBacksteps updates the given refs to be relative paths, relative to the given base directory as long as they do not require backsteps. Any path requiring a backstep is left as-is as long it is absolute.  Any non-absolute path that can't be relativized produces an error\n\n```go\nfunc RemoveNamespacesPrefix(value string) (string, error)\n```\nRemoveNamespacesPrefix is a transformer that strips \"ns/\", \"namespace/\" and \"namespaces/\" prefixes case-insensitively\n\n```go\nfunc ResolveConfigPaths(config *clientcmdapi.Config, base string) error\n```\n\n```go\nfunc ResolveLocalPaths(config *clientcmdapi.Config) error\n```\nResolveLocalPaths resolves all relative paths in the config object with respect to the stanza's LocationOfOrigin this cannot be done directly inside of LoadFromFile because doing so there would make it impossible to load a file without modification of its contents.\n\n```go\nfunc ResolvePaths(refs []*string, base string) error\n```\nResolvePaths updates the given refs to be absolute paths, relative to the given base directory\n\n```go\nfunc Validate(config clientcmdapi.Config) error\n```\nValidate checks for errors in the Config.  It does not return early so that it can find as many errors as possible.\n\n```go\nfunc Write(config clientcmdapi.Config) ([]byte, error)\n```\nWrite serializes the config to yaml. Encapsulates serialization without assuming the destination is a file.\n\n```go\nfunc WriteToFile(config clientcmdapi.Config, filename string) error\n```\nWriteToFile serializes the config to yaml and writes it out to a file.  If not present, it creates the file with the mode 0600.  If it is present it stomps the contents\n\n## Types\n\n```go\ntype AuthLoader interface {\n\t// LoadAuth takes a path to a config file and can then do anything it needs in order to return a valid clientauth.Info\n\tLoadAuth(path string) (*clientauth.Info, error)\n}\n```\nAuthLoaders are used to build clientauth.Info objects.\n\n```go\nfunc NewDefaultAuthLoader() AuthLoader\n```\nNewDefaultAuthLoader returns a default implementation of an AuthLoader that only reads from a config file\n\n```go\ntype AuthOverrideFlags struct {\n\tClientCertificate FlagInfo\n\tClientKey         FlagInfo\n\tToken             FlagInfo\n\tImpersonate       FlagInfo\n\tImpersonateGroups FlagInfo\n\tUsername          FlagInfo\n\tPassword          FlagInfo\n}\n```\nAuthOverrideFlags holds the flag names to be used for binding command line flags for AuthInfo objects\n\n```go\nfunc RecommendedAuthOverrideFlags(prefix string) AuthOverrideFlags\n```\nRecommendedAuthOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing\n\n```go\ntype ClientConfig interface {\n\t// RawConfig returns the merged result of all overrides\n\tRawConfig() (clientcmdapi.Config, error)\n\t// ClientConfig returns a complete client config\n\tClientConfig() (*restclient.Config, error)\n\t// Namespace returns the namespace resulting from the merged\n\t// result of all overrides and a boolean indicating if it was\n\t// overridden\n\tNamespace() (string, bool, error)\n\t// ConfigAccess returns the rules for loading/persisting the config.\n\tConfigAccess() ConfigAccess\n}\n```\nClientConfig is used to make it easy to get an api server client\n\n```go\nfunc NewClientConfigFromBytes(configBytes []byte) (ClientConfig, error)\n```\nNewClientConfigFromBytes takes your kubeconfig and gives you back a ClientConfig\n\n```go\nfunc NewDefaultClientConfig(config clientcmdapi.Config, overrides *ConfigOverrides) ClientConfig\n```\nNewDefaultClientConfig creates a DirectClientConfig using the config.CurrentContext as the context name\n\n```go\nfunc NewInteractiveClientConfig(config clientcmdapi.Config, contextName string, overrides *ConfigOverrides, fallbackReader io.Reader, configAccess ConfigAccess) ClientConfig\n```\nNewInteractiveClientConfig creates a DirectClientConfig using the passed context name and a reader in case auth information is not provided via files or flags\n\n```go\nfunc NewInteractiveDeferredLoadingClientConfig(loader ClientConfigLoader, overrides *ConfigOverrides, fallbackReader io.Reader) ClientConfig\n```\nNewInteractiveDeferredLoadingClientConfig creates a ConfigClientClientConfig using the passed context name and the fallback auth reader\n\n```go\nfunc NewNonInteractiveClientConfig(config clientcmdapi.Config, contextName string, overrides *ConfigOverrides, configAccess ConfigAccess) ClientConfig\n```\nNewNonInteractiveClientConfig creates a DirectClientConfig using the passed context name and does not have a fallback reader for auth information\n\n```go\nfunc NewNonInteractiveDeferredLoadingClientConfig(loader ClientConfigLoader, overrides *ConfigOverrides) ClientConfig\n```\nNewNonInteractiveDeferredLoadingClientConfig creates a ConfigClientClientConfig using the passed context name\n\n```go\ntype ClientConfigGetter struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (g *ClientConfigGetter) GetDefaultFilename() string\n```\n\n```go\nfunc (g *ClientConfigGetter) GetExplicitFile() string\n```\n\n```go\nfunc (g *ClientConfigGetter) GetLoadingPrecedence() []string\n```\n\n```go\nfunc (g *ClientConfigGetter) GetStartingConfig() (*clientcmdapi.Config, error)\n```\n\n```go\nfunc (g *ClientConfigGetter) IsDefaultConfig(config *restclient.Config) bool\n```\n\n```go\nfunc (g *ClientConfigGetter) IsExplicitFile() bool\n```\n\n```go\nfunc (g *ClientConfigGetter) Load() (*clientcmdapi.Config, error)\n```\n\n```go\ntype ClientConfigLoader interface {\n\tConfigAccess\n\t// IsDefaultConfig returns true if the returned config matches the defaults.\n\tIsDefaultConfig(*restclient.Config) bool\n\t// Load returns the latest config\n\tLoad() (*clientcmdapi.Config, error)\n}\n```\n\n```go\ntype ClientConfigLoadingRules struct {\n\tExplicitPath string\n\tPrecedence   []string\n\n\t// MigrationRules is a map of destination files to source files.  If a destination file is not present, then the source file is checked.\n\t// If the source file is present, then it is copied to the destination file BEFORE any further loading happens.\n\tMigrationRules map[string]string\n\n\t// DoNotResolvePaths indicates whether or not to resolve paths with respect to the originating files.  This is phrased as a negative so\n\t// that a default object that doesn't set this will usually get the behavior it wants.\n\tDoNotResolvePaths bool\n\n\t// DefaultClientConfig is an optional field indicating what rules to use to calculate a default configuration.\n\t// This should match the overrides passed in to ClientConfig loader.\n\tDefaultClientConfig ClientConfig\n}\n```\nClientConfigLoadingRules is an ExplicitPath and string slice of specific locations that are used for merging together a Config Callers can put the chain together however they want, but we'd recommend: EnvVarPathFiles if set (a list of files if set) OR the HomeDirectoryPath ExplicitPath is special, because if a user specifically requests a certain file be used and error is reported if this file is not present\n\n```go\nfunc NewDefaultClientConfigLoadingRules() *ClientConfigLoadingRules\n```\nNewDefaultClientConfigLoadingRules returns a ClientConfigLoadingRules object with default fields filled in.  You are not required to use this constructor\n\n```go\nfunc (rules *ClientConfigLoadingRules) GetDefaultFilename() string\n```\nGetDefaultFilename implements ConfigAccess\n\n```go\nfunc (rules *ClientConfigLoadingRules) GetExplicitFile() string\n```\nGetExplicitFile implements ConfigAccess\n\n```go\nfunc (rules *ClientConfigLoadingRules) GetLoadingPrecedence() []string\n```\nGetLoadingPrecedence implements ConfigAccess\n\n```go\nfunc (rules *ClientConfigLoadingRules) GetStartingConfig() (*clientcmdapi.Config, error)\n```\nGetStartingConfig implements ConfigAccess\n\n```go\nfunc (rules *ClientConfigLoadingRules) IsDefaultConfig(config *restclient.Config) bool\n```\nIsDefaultConfig returns true if the provided configuration matches the default\n\n```go\nfunc (rules *ClientConfigLoadingRules) IsExplicitFile() bool\n```\nIsExplicitFile implements ConfigAccess\n\n```go\nfunc (rules *ClientConfigLoadingRules) Load() (*clientcmdapi.Config, error)\n```\nLoad starts by running the MigrationRules and then takes the loading rules and returns a Config object based on following rules.\n\n\tif the ExplicitPath, return the unmerged explicit file\n\tOtherwise, return a merged config based on the Precedence slice\n\nA missing ExplicitPath file produces an error. Empty filenames or other missing files are ignored. Read errors or files with non-deserializable content produce errors. The first file to set a particular map key wins and map key's value is never changed. BUT, if you set a struct value that is NOT contained inside of map, the value WILL be changed. This results in some odd looking logic to merge in one direction, merge in the other, and then merge the two. It also means that if two files specify a \"red-user\", only values from the first file's red-user are used.  Even non-conflicting entries from the second file's \"red-user\" are discarded. Relative paths inside of the .kubeconfig files are resolved against the .kubeconfig file's parent folder and only absolute file paths are returned.\n\n```go\nfunc (rules *ClientConfigLoadingRules) Migrate() error\n```\nMigrate uses the MigrationRules map.  If a destination file is not present, then the source file is checked. If the source file is present, then it is copied to the destination file BEFORE any further loading happens.\n\n```go\nfunc (rules ClientConfigLoadingRules) ResolvePaths() bool\n```\n\n```go\ntype ClusterOverrideFlags struct {\n\tAPIServer             FlagInfo\n\tAPIVersion            FlagInfo\n\tCertificateAuthority  FlagInfo\n\tInsecureSkipTLSVerify FlagInfo\n}\n```\nClusterOverride holds the flag names to be used for binding command line flags for Cluster objects\n\n```go\nfunc RecommendedClusterOverrideFlags(prefix string) ClusterOverrideFlags\n```\nRecommendedClusterOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing\n\n```go\ntype ConfigAccess interface {\n\t// GetLoadingPrecedence returns the slice of files that should be used for loading and inspecting the config\n\tGetLoadingPrecedence() []string\n\t// GetStartingConfig returns the config that subcommands should being operating against.  It may or may not be merged depending on loading rules\n\tGetStartingConfig() (*clientcmdapi.Config, error)\n\t// GetDefaultFilename returns the name of the file you should write into (create if necessary), if you're trying to create a new stanza as opposed to updating an existing one.\n\tGetDefaultFilename() string\n\t// IsExplicitFile indicates whether or not this command is interested in exactly one file.  This implementation only ever does that  via a flag, but implementations that handle local, global, and flags may have more\n\tIsExplicitFile() bool\n\t// GetExplicitFile returns the particular file this command is operating against.  This implementation only ever has one, but implementations that handle local, global, and flags may have more\n\tGetExplicitFile() string\n}\n```\nConfigAccess is used by subcommands and methods in this package to load and modify the appropriate config files\n\n```go\ntype ConfigOverrideFlags struct {\n\tAuthOverrideFlags    AuthOverrideFlags\n\tClusterOverrideFlags ClusterOverrideFlags\n\tContextOverrideFlags ContextOverrideFlags\n\tCurrentContext       FlagInfo\n\tTimeout              FlagInfo\n}\n```\nConfigOverrideFlags holds the flag names to be used for binding command line flags. Notice that this structure tightly corresponds to ConfigOverrides\n\n```go\nfunc RecommendedConfigOverrideFlags(prefix string) ConfigOverrideFlags\n```\nRecommendedConfigOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing\n\n```go\ntype ConfigOverrides struct {\n\tAuthInfo clientcmdapi.AuthInfo\n\t// ClusterDefaults are applied before the configured cluster info is loaded.\n\tClusterDefaults clientcmdapi.Cluster\n\tClusterInfo     clientcmdapi.Cluster\n\tContext         clientcmdapi.Context\n\tCurrentContext  string\n\tTimeout         string\n}\n```\nConfigOverrides holds values that should override whatever information is pulled from the actual Config object.  You can't simply use an actual Config object, because Configs hold maps, but overrides are restricted to \"at most one\"\n\n```go\ntype ContextOverrideFlags struct {\n\tClusterName  FlagInfo\n\tAuthInfoName FlagInfo\n\tNamespace    FlagInfo\n}\n```\nContextOverrideFlags holds the flag names to be used for binding command line flags for Cluster objects\n\n```go\nfunc RecommendedContextOverrideFlags(prefix string) ContextOverrideFlags\n```\nRecommendedContextOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing\n\n```go\ntype DeferredLoadingClientConfig struct {\n\t// contains filtered or unexported fields\n}\n```\nDeferredLoadingClientConfig is a ClientConfig interface that is backed by a client config loader. It is used in cases where the loading rules may change after you've instantiated them and you want to be sure that the most recent rules are used.  This is useful in cases where you bind flags to loading rule parameters before the parse happens and you want your calling code to be ignorant of how the values are being mutated to avoid passing extraneous information down a call stack\n\n```go\nfunc (config *DeferredLoadingClientConfig) ClientConfig() (*restclient.Config, error)\n```\nClientConfig implements ClientConfig\n\n```go\nfunc (config *DeferredLoadingClientConfig) ConfigAccess() ConfigAccess\n```\nConfigAccess implements ClientConfig\n\n```go\nfunc (config *DeferredLoadingClientConfig) Namespace() (string, bool, error)\n```\nNamespace implements KubeConfig\n\n```go\nfunc (config *DeferredLoadingClientConfig) RawConfig() (clientcmdapi.Config, error)\n```\n\n```go\ntype DirectClientConfig struct {\n\t// contains filtered or unexported fields\n}\n```\nDirectClientConfig is a ClientConfig interface that is backed by a clientcmdapi.Config, options overrides, and an optional fallbackReader for auth information\n\n```go\nfunc (config *DirectClientConfig) ClientConfig() (*restclient.Config, error)\n```\nClientConfig implements ClientConfig\n\n```go\nfunc (config *DirectClientConfig) ConfigAccess() ConfigAccess\n```\nConfigAccess implements ClientConfig\n\n```go\nfunc (config *DirectClientConfig) ConfirmUsable() error\n```\nConfirmUsable looks a particular context and determines if that particular part of the config is useable.  There might still be errors in the config, but no errors in the sections requested or referenced.  It does not return early so that it can find as many errors as possible.\n\n```go\nfunc (config *DirectClientConfig) Namespace() (string, bool, error)\n```\nNamespace implements ClientConfig\n\n```go\nfunc (config *DirectClientConfig) RawConfig() (clientcmdapi.Config, error)\n```\n\n```go\ntype FlagInfo struct {\n\t// LongName is the long string for a flag.  If this is empty, then the flag will not be bound\n\tLongName string\n\t// ShortName is the single character for a flag.  If this is empty, then there will be no short flag\n\tShortName string\n\t// Default is the default value for the flag\n\tDefault string\n\t// Description is the description for the flag\n\tDescription string\n}\n```\nFlagInfo contains information about how to register a flag.  This struct is useful if you want to provide a way for an extender to get back a set of recommended flag names, descriptions, and defaults, but allow for customization by an extender.  This makes for coherent extension, without full prescription\n\n```go\nfunc (f FlagInfo) AddSecretAnnotation(flags *pflag.FlagSet) FlagInfo\n```\nAddSecretAnnotation add secret flag to Annotation.\n\n```go\nfunc (f FlagInfo) BindBoolFlag(flags *pflag.FlagSet, target *bool) FlagInfo\n```\nBindBoolFlag binds the flag based on the provided info.  If LongName == \"\", nothing is registered\n\n```go\nfunc (f FlagInfo) BindStringArrayFlag(flags *pflag.FlagSet, target *[]string) FlagInfo\n```\nBindStringSliceFlag binds the flag based on the provided info.  If LongName == \"\", nothing is registered\n\n```go\nfunc (f FlagInfo) BindStringFlag(flags *pflag.FlagSet, target *string) FlagInfo\n```\nBindStringFlag binds the flag based on the provided info.  If LongName == \"\", nothing is registered\n\n```go\nfunc (f FlagInfo) BindTransformingStringFlag(flags *pflag.FlagSet, target *string, transformer func(string) (string, error)) FlagInfo\n```\nBindTransformingStringFlag binds the flag based on the provided info.  If LongName == \"\", nothing is registered\n\n```go\ntype InClusterConfig interface {\n\tClientConfig\n\tPossible() bool\n}\n```\nInClusterConfig abstracts details of whether the client is running in a cluster for testing.\n\n```go\ntype KubeconfigGetter func() (*clientcmdapi.Config, error)\n```\n\n```go\ntype PathOptions struct {\n\t// GlobalFile is the full path to the file to load as the global (final) option\n\tGlobalFile string\n\t// EnvVar is the env var name that points to the list of kubeconfig files to load\n\tEnvVar string\n\t// ExplicitFileFlag is the name of the flag to use for prompting for the kubeconfig file\n\tExplicitFileFlag string\n\n\t// GlobalFileSubpath is an optional value used for displaying help\n\tGlobalFileSubpath string\n\n\tLoadingRules *ClientConfigLoadingRules\n}\n```\n\n```go\nfunc NewDefaultPathOptions() *PathOptions\n```\n\n```go\nfunc (o *PathOptions) GetDefaultFilename() string\n```\n\n```go\nfunc (o *PathOptions) GetEnvVarFiles() []string\n```\n\n```go\nfunc (o *PathOptions) GetExplicitFile() string\n```\n\n```go\nfunc (o *PathOptions) GetLoadingPrecedence() []string\n```\n\n```go\nfunc (o *PathOptions) GetStartingConfig() (*clientcmdapi.Config, error)\n```\n\n```go\nfunc (o *PathOptions) IsExplicitFile() bool\n```\n\n```go\ntype PersistAuthProviderConfigForUser func(user string) restclient.AuthProviderConfigPersister\n```\n\n```go\ntype PromptingAuthLoader struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewPromptingAuthLoader(reader io.Reader) *PromptingAuthLoader\n```\nNewPromptingAuthLoader is an AuthLoader that parses an AuthInfo object from a file path. It prompts user and creates file if it doesn't exist.\n\n```go\nfunc (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error)\n```\nLoadAuth parses an AuthInfo object from a file path. It prompts user and creates file if it doesn't exist.\n\n```go\nfunc (a *PromptingAuthLoader) Prompt() (*clientauth.Info, error)\n```\nPrompt pulls the user and password from a reader\n\n","path":"github.com/UnityTech/client-go/tools/clientcmd","name":"clientcmd","synopsis":"Package clientcmd provides one stop shopping for building a working client from a fixed config, from a .kubeconfig file, from command line flags, or from any merged combination.","isRedistributable":true}
