{"modulePath":"github.com/2lambda123/openshift-origin","version":"v3.10.0+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package clientcmd\n\n## Functions\n\n```go\nfunc AsVersionedObject(infos []*resource.Info, forceList bool, version schema.GroupVersion, encoder runtime.Encoder) (runtime.Object, error)\n```\nAsVersionedObject converts a list of infos into a single object - either a List containing the objects as children, or if only a single Object is present, as that object. The provided version will be preferred as the conversion target, but the Object's mapping version will be used if that version is not present.\n\n```go\nfunc AsVersionedObjects(infos []*resource.Info, version schema.GroupVersion, encoder runtime.Encoder) ([]runtime.Object, error)\n```\nAsVersionedObjects converts a list of infos into versioned objects. The provided version will be preferred as the conversion target, but the Object's mapping version will be used if that version is not present.\n\n```go\nfunc ConvertExteralPodSpecToInternal(inFn func(*corev1.PodSpec) error) func(*kapi.PodSpec) error\n```\n\n```go\nfunc ConvertInteralPodSpecToExternal(inFn func(*kapi.PodSpec) error) func(*corev1.PodSpec) error\n```\n\n```go\nfunc DefaultGenerators(cmdName string) map[string]kubectl.Generator\n```\n\n```go\nfunc FindAllCanonicalResources(d discovery.DiscoveryInterface, m meta.RESTMapper) ([]schema.GroupResource, error)\n```\nFindAllCanonicalResources returns all resource names that map directly to their kind (Kind -\u003e Resource -\u003e Kind) and are not subresources. This is the closest mapping possible from the client side to resources that can be listed and updated. Note that this may return some virtual resources (like imagestreamtags) that can be otherwise represented. TODO: add a field to APIResources for \"virtual\" (or that points to the canonical resource). TODO: fallback to the scheme when discovery is not possible.\n\n```go\nfunc NewBuilderFactory(clientAccessFactory kcmdutil.ClientAccessFactory, objectMappingFactory kcmdutil.ObjectMappingFactory) kcmdutil.BuilderFactory\n```\n\n```go\nfunc NewClientAccessFactory(optionalClientConfig kclientcmd.ClientConfig) kcmdutil.ClientAccessFactory\n```\n\n```go\nfunc NewObjectMappingFactory(clientAccessFactory kcmdutil.ClientAccessFactory) kcmdutil.ObjectMappingFactory\n```\n\n```go\nfunc ParseDockerImageReferenceToStringFunc(spec string) (string, error)\n```\n\n```go\nfunc ResourceMapper(f kcmdutil.Factory) *resource.Mapper\n```\n\n## Types\n\n```go\ntype Factory struct {\n\tkcmdutil.ClientAccessFactory\n\tkcmdutil.ObjectMappingFactory\n\tkcmdutil.BuilderFactory\n}\n```\nFactory provides common options for OpenShift commands\n\n```go\nfunc New(flags *pflag.FlagSet) *Factory\n```\nNew creates a default Factory for commands that should share identical server connection behavior. Most commands should use this method to get a factory.\n\n```go\nfunc NewFactory(optionalClientConfig kclientcmd.ClientConfig) *Factory\n```\nNewFactory creates an object that holds common methods across all OpenShift commands\n\n```go\nfunc (f *Factory) ApproximatePodTemplateForObject(object runtime.Object) (*api.PodTemplateSpec, error)\n```\nApproximatePodTemplateForObject returns a pod template object for the provided source. It may return both an error and a object. It attempt to return the best possible template available at the current time.\n\n```go\nfunc (f *Factory) ExtractFileContents(obj runtime.Object) (map[string][]byte, bool, error)\n```\nExtractFileContents returns a map of keys to contents, false if the object cannot support such an operation, or an error.\n\n```go\nfunc (f *Factory) PodForResource(resource string, timeout time.Duration) (string, error)\n```\n\n```go\nfunc (f *Factory) PrintResourceInfos(cmd *cobra.Command, isLocal bool, infos []*resource.Info, out io.Writer) error\n```\nPrintResourceInfos receives a list of resource infos and prints versioned objects if a generic output format was specified otherwise, it iterates through info objects, printing each resource with a unique printer for its mapping\n\n```go\nfunc (f *Factory) UpdateObjectEnvironment(obj runtime.Object, fn func(*[]api.EnvVar) error) (bool, error)\n```\nUpdateObjectEnvironment update the environment variables in object specification.\n\n```go\ntype FlagBinder interface {\n\t// Bound returns true if the flag is already bound to a command.\n\tBound() bool\n\t// Bind allows to bind an extra flag to a command\n\tBind(*pflag.FlagSet)\n}\n```\nFlagBinder represents an interface that allows to bind extra flags into commands.\n\n","path":"github.com/2lambda123/openshift-origin/pkg/oc/cli/util/clientcmd","name":"clientcmd","synopsis":"","isRedistributable":true}
