Documentation ¶
Index ¶
- func GetApplicationsForCompletion(ctx context.Context, f Factory, namespace string, toComplete string) ([]string, cobra.ShellCompDirective)
- func GetNamespace(f Factory, cmd *cobra.Command) string
- func GetNamespacesForCompletion(ctx context.Context, f Factory, toComplete string) ([]string, cobra.ShellCompDirective)
- func GetRevisionForCompletion(ctx context.Context, f Factory, appName string, namespace string, ...) ([]string, cobra.ShellCompDirective)
- type Builder
- type ClientGetter
- type Factory
- type NamespaceFlagConfig
- type NamespaceFlagDisableEnvOption
- type NamespaceFlagNoCompletionOption
- type NamespaceFlagOption
- type NamespaceFlagUsageOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetApplicationsForCompletion ¶
func GetApplicationsForCompletion(ctx context.Context, f Factory, namespace string, toComplete string) ([]string, cobra.ShellCompDirective)
GetApplicationsForCompletion auto-complete application
func GetNamespace ¶
GetNamespace get namespace from command flags and env
func GetNamespacesForCompletion ¶
func GetNamespacesForCompletion(ctx context.Context, f Factory, toComplete string) ([]string, cobra.ShellCompDirective)
GetNamespacesForCompletion auto-complete the namespace
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder build command with factory
func NewCommandBuilder ¶
NewCommandBuilder builder for command
func (*Builder) WithEnvFlag ¶
WithEnvFlag add env flag to the command
func (*Builder) WithNamespaceFlag ¶
func (builder *Builder) WithNamespaceFlag(options ...NamespaceFlagOption) *Builder
WithNamespaceFlag add namespace flag to the command, by default, it will also add env flag to the command
func (*Builder) WithResponsiveWriter ¶
WithResponsiveWriter format the command outputs
type ClientGetter ¶
ClientGetter function for getting client
type Factory ¶
Factory client factory for running command
func NewDefaultFactory ¶
func NewDefaultFactory(clientGetter ClientGetter) Factory
NewDefaultFactory create a factory based on client getter function
type NamespaceFlagConfig ¶
type NamespaceFlagConfig struct {
// contains filtered or unexported fields
}
NamespaceFlagConfig config for namespace flag in cmd
type NamespaceFlagDisableEnvOption ¶
type NamespaceFlagDisableEnvOption struct{}
NamespaceFlagDisableEnvOption disable loading namespace from env
func (NamespaceFlagDisableEnvOption) ApplyToNamespaceFlagOptions ¶
func (option NamespaceFlagDisableEnvOption) ApplyToNamespaceFlagOptions(cfg *NamespaceFlagConfig)
ApplyToNamespaceFlagOptions .
type NamespaceFlagNoCompletionOption ¶
type NamespaceFlagNoCompletionOption struct{}
NamespaceFlagNoCompletionOption disable auto-completion for namespace flag
func (NamespaceFlagNoCompletionOption) ApplyToNamespaceFlagOptions ¶
func (option NamespaceFlagNoCompletionOption) ApplyToNamespaceFlagOptions(cfg *NamespaceFlagConfig)
ApplyToNamespaceFlagOptions .
type NamespaceFlagOption ¶
type NamespaceFlagOption interface {
ApplyToNamespaceFlagOptions(*NamespaceFlagConfig)
}
NamespaceFlagOption the option for configuring namespace flag in cmd
type NamespaceFlagUsageOption ¶
type NamespaceFlagUsageOption string
NamespaceFlagUsageOption the usage description for namespace flag
func (NamespaceFlagUsageOption) ApplyToNamespaceFlagOptions ¶
func (option NamespaceFlagUsageOption) ApplyToNamespaceFlagOptions(cfg *NamespaceFlagConfig)
ApplyToNamespaceFlagOptions .