Documentation
¶
Overview ¶
nolint:dupl
nolint:dupl
Index ¶
- func CmdCompletionFuncToCobraCompletionFunc(c CmdCompletionFunc) ...
- func CompleterToCobraCompletionFunc(c Completer) ...
- func ListKubeconfigClusterCompletionFunc(cmd *cobra.Command) ([]string, error)
- func ListKubeconfigContextCompletionFunc(cmd *cobra.Command) ([]string, error)
- func MakeCobraCompletionFunc(f Func) ...
- func RegisterFlagCompletions(cmd *cobra.Command, completions []FlagCompletion) error
- type CmdCompletionFunc
- type Completer
- type FlagCompletion
- type Func
- type ListJobConfigsCompleter
- type ListJobsCompleter
- type ListNamespacesCompleter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CmdCompletionFuncToCobraCompletionFunc ¶
func CmdCompletionFuncToCobraCompletionFunc(c CmdCompletionFunc) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
CmdCompletionFuncToCobraCompletionFunc converts a CmdCompletionFunc into a cobra completion function.
func CompleterToCobraCompletionFunc ¶
func CompleterToCobraCompletionFunc(c Completer) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
CompleterToCobraCompletionFunc converts a Completer into a cobra completion function.
func ListKubeconfigClusterCompletionFunc ¶
ListKubeconfigClusterCompletionFunc knows how to list clusters from the kubeconfig.
func ListKubeconfigContextCompletionFunc ¶
ListKubeconfigContextCompletionFunc knows how to list contexts from the kubeconfig.
func MakeCobraCompletionFunc ¶
func MakeCobraCompletionFunc(f Func) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
MakeCobraCompletionFunc converts a Func into a cobra completion function.
func RegisterFlagCompletions ¶
func RegisterFlagCompletions(cmd *cobra.Command, completions []FlagCompletion) error
RegisterFlagCompletions registers all FlagCompletion entries and returns an error if any flag returned an error.
Types ¶
type CmdCompletionFunc ¶
CmdCompletionFunc is a completion func that only needs a *cobra.Command.
type Completer ¶
type Completer interface {
Complete(ctx context.Context, ctrlContext controllercontext.Context, namespace string) ([]string, error)
}
Completer is the interface of Func.
func NewSliceCompleter ¶
NewSliceCompleter is a Completer from a slice of objects.
type FlagCompletion ¶
type FlagCompletion struct {
FlagName string
CompletionFunc Func
CmdCompletionFunc CmdCompletionFunc
Completer Completer
}
FlagCompletion defines a single flag completion entry.
type Func ¶
type Func func(ctx context.Context, ctrlContext controllercontext.Context, namespace string) ([]string, error)
Func is a completion func, that knows how to return completions.
type ListJobConfigsCompleter ¶
type ListJobConfigsCompleter struct {
// If specified, overrides the sort function.
Sort func(a, b *execution.JobConfig) bool
// If specified, filters out job configs that should not appear in completions.
Filter func(job *execution.JobConfig) bool
// If specified, overrides the text formatted in the completion.
// Use \t to add labels for the completion values.
Format func(job *execution.JobConfig) string
}
ListJobConfigsCompleter is a Completer that lists job configs.
func (*ListJobConfigsCompleter) Complete ¶
func (c *ListJobConfigsCompleter) Complete(ctx context.Context, ctrlContext controllercontext.Context, namespace string) ([]string, error)
type ListJobsCompleter ¶
type ListJobsCompleter struct {
// If specified, overrides the sort function.
Sort func(a, b *execution.Job) bool
// If specified, filters out jobs that should not appear in completions.
Filter func(job *execution.Job) bool
// If specified, overrides the text formatted in the completion.
// Use \t to add labels for the completion values.
Format func(job *execution.Job) string
}
ListJobsCompleter is a Completer that lists jobs.
func (*ListJobsCompleter) Complete ¶
func (c *ListJobsCompleter) Complete(ctx context.Context, ctrlContext controllercontext.Context, namespace string) ([]string, error)
type ListNamespacesCompleter ¶
type ListNamespacesCompleter struct {
// If specified, overrides the sort function.
Sort func(a, b *corev1.Namespace) bool
// If specified, filters out job configs that should not appear in completions.
Filter func(ns *corev1.Namespace) bool
// If specified, overrides the text formatted in the completion.
// Use \t to add labels for the completion values.
Format func(ns *corev1.Namespace) string
}
ListNamespacesCompleter is a Completer that lists job configs.
func (*ListNamespacesCompleter) Complete ¶
func (c *ListNamespacesCompleter) Complete(ctx context.Context, ctrlContext controllercontext.Context, _ string) ([]string, error)