completion

package
v1.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompGetContainers

func CompGetContainers(f util.Factory, cmd *cobra.Command, podName string, toComplete string) []string

CompGetContainers gets the list of containers of the specified pod which begin with `toComplete`.

func CompGetFromTemplate

func CompGetFromTemplate(template *string, f util.Factory, cmd *cobra.Command, namespace string, args []string, toComplete string) []string

CompGetFromTemplate executes a Get operation using the specified template and args and returns the results which begin with `toComplete`.

func CompGetResource

func CompGetResource(f util.Factory, cmd *cobra.Command, resourceName string, toComplete string) []string

CompGetResource gets the list of the resource specified which begin with `toComplete`.

func ContainerCompletionFunc

func ContainerCompletionFunc(f util.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

ContainerCompletionFunc Returns a completion function that completes the containers within the pod specified by the first argument. The resource containing the pod can be specified in the <type>/<name> form.

func ListClustersInConfig

func ListClustersInConfig(toComplete string) []string

ListClustersInConfig returns a list of cluster names which begin with `toComplete`

func ListContextsInConfig

func ListContextsInConfig(toComplete string) []string

ListContextsInConfig returns a list of context names which begin with `toComplete`

func PodResourceNameAndContainerCompletionFunc

func PodResourceNameAndContainerCompletionFunc(f util.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

PodResourceNameAndContainerCompletionFunc Returns a completion function that completes, as a first argument: 1- pod names that match the toComplete prefix 2- resource types containing pods which match the toComplete prefix and as a second argument the containers within the specified pod.

func PodResourceNameCompletionFunc

func PodResourceNameCompletionFunc(f util.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

PodResourceNameCompletionFunc Returns a completion function that completes: 1- pod names that match the toComplete prefix 2- resource types containing pods which match the toComplete prefix

func RegisterCompletionFuncForClusterFlag

func RegisterCompletionFuncForClusterFlag(cmd *cobra.Command)

RegisterCompletionFuncForClusterFlag registers CompletionFunc for flag cluster.

func RegisterCompletionFuncForClustersFlag

func RegisterCompletionFuncForClustersFlag(cmd *cobra.Command)

RegisterCompletionFuncForClustersFlag registers CompletionFunc for flag clusters.

func RegisterCompletionFuncForKarmadaContextFlag

func RegisterCompletionFuncForKarmadaContextFlag(cmd *cobra.Command)

RegisterCompletionFuncForKarmadaContextFlag registers CompletionFunc for flag karmada-context.

func RegisterCompletionFuncForNamespaceFlag

func RegisterCompletionFuncForNamespaceFlag(cmd *cobra.Command, f util.Factory)

RegisterCompletionFuncForNamespaceFlag registers CompletionFunc for flag namespace.

func RegisterCompletionFuncForOperationScopeFlag

func RegisterCompletionFuncForOperationScopeFlag(cmd *cobra.Command, supportScope ...options.OperationScope)

RegisterCompletionFuncForOperationScopeFlag registers CompletionFunc for flag operation-scope.

func ResourceNameCompletionFunc

func ResourceNameCompletionFunc(f util.Factory, resourceType string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

ResourceNameCompletionFunc Returns a completion function that completes as a first argument the resource names specified by the resourceType parameter, and which match the toComplete prefix. This function does NOT support the <type>/<name> form: it is meant to be used by commands that don't support that form. For commands that apply to pods and that support the <type>/<name> form, please use PodResourceNameCompletionFunc()

func ResourceTypeAndNameCompletionFunc

func ResourceTypeAndNameCompletionFunc(f util.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

ResourceTypeAndNameCompletionFunc Returns a completion function that completes resource types and resource names that match the toComplete prefix. It supports the <type>/<name> form.

func SetFactoryForCompletion

func SetFactoryForCompletion(f util.Factory)

SetFactoryForCompletion Store the factory which is needed by the completion functions. Not all commands have access to the factory, so cannot pass it to the completion functions.

func SpecifiedResourceTypeAndNameCompletionFunc

func SpecifiedResourceTypeAndNameCompletionFunc(f util.Factory, allowedTypes []string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

SpecifiedResourceTypeAndNameCompletionFunc Returns a completion function that completes resource types limited to the specified allowedTypes, and resource names that match the toComplete prefix. It allows for multiple resources. It supports the <type>/<name> form.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL