Documentation ¶
Index ¶
- Variables
- func GetApplicationsForCompletion(ctx context.Context, f Factory, namespace string, toComplete string) ([]string, cobra.ShellCompDirective)
- func GetCluster(cmd *cobra.Command) string
- func GetClusters(cmd *cobra.Command) []string
- func GetClustersForCompletion(ctx context.Context, f Factory, 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)
- func GetServiceAccountForCompletion(ctx context.Context, f Factory, namespace string, toComplete string) ([]string, cobra.ShellCompDirective)
- type Builder
- func (builder *Builder) Build() *cobra.Command
- func (builder *Builder) WithClusterFlag(options ...ClusterFlagOption) *Builder
- func (builder *Builder) WithEnvFlag() *Builder
- func (builder *Builder) WithNamespaceFlag(options ...NamespaceFlagOption) *Builder
- func (builder *Builder) WithResponsiveWriter() *Builder
- func (builder *Builder) WithStreams(streams util.IOStreams) *Builder
- type ClientGetter
- type ClusterFlagConfig
- type ClusterFlagDisableSliceInputOption
- type ClusterFlagOption
- type ConfigGetter
- type Factory
- type FlagNoCompletionOption
- type NamespaceFlagConfig
- type NamespaceFlagDisableEnvOption
- type NamespaceFlagOption
- type UsageOption
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultRateLimiter default rate limiter for cmd client DefaultRateLimiter = flowcontrol.NewTokenBucketRateLimiter(100, 200) )
Functions ¶
func GetApplicationsForCompletion ¶
func GetApplicationsForCompletion(ctx context.Context, f Factory, namespace string, toComplete string) ([]string, cobra.ShellCompDirective)
GetApplicationsForCompletion auto-complete application
func GetCluster ¶ added in v1.4.0
GetCluster get cluster from command flags
func GetClusters ¶ added in v1.4.0
GetClusters get cluster from command flags
func GetClustersForCompletion ¶ added in v1.4.0
func GetClustersForCompletion(ctx context.Context, f Factory, toComplete string) ([]string, cobra.ShellCompDirective)
GetClustersForCompletion auto-complete the cluster
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
func GetRevisionForCompletion ¶
func GetRevisionForCompletion(ctx context.Context, f Factory, appName string, namespace string, toComplete string) ([]string, cobra.ShellCompDirective)
GetRevisionForCompletion auto-complete the revision according to the application
func GetServiceAccountForCompletion ¶ added in v1.4.0
func GetServiceAccountForCompletion(ctx context.Context, f Factory, namespace string, toComplete string) ([]string, cobra.ShellCompDirective)
GetServiceAccountForCompletion auto-complete serviceaccount
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder build command with factory
func NewCommandBuilder ¶
NewCommandBuilder builder for command
func (*Builder) WithClusterFlag ¶ added in v1.4.0
func (builder *Builder) WithClusterFlag(options ...ClusterFlagOption) *Builder
WithClusterFlag add cluster flag to the 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 ClusterFlagConfig ¶ added in v1.4.0
type ClusterFlagConfig struct {
// contains filtered or unexported fields
}
ClusterFlagConfig config for cluster flag in cmd
type ClusterFlagDisableSliceInputOption ¶ added in v1.4.0
type ClusterFlagDisableSliceInputOption struct{}
ClusterFlagDisableSliceInputOption set the cluster flag to allow multiple input
func (ClusterFlagDisableSliceInputOption) ApplyToClusterFlagOptions ¶ added in v1.4.0
func (option ClusterFlagDisableSliceInputOption) ApplyToClusterFlagOptions(cfg *ClusterFlagConfig)
ApplyToClusterFlagOptions .
type ClusterFlagOption ¶ added in v1.4.0
type ClusterFlagOption interface {
ApplyToClusterFlagOptions(*ClusterFlagConfig)
}
ClusterFlagOption the option for configuring cluster flag
type ConfigGetter ¶ added in v1.4.0
ConfigGetter function for getting config
type Factory ¶
Factory client factory for running command
func NewDefaultFactory ¶
NewDefaultFactory create a factory based on client getter function
func NewDeferredFactory ¶ added in v1.4.1
func NewDeferredFactory(getter ConfigGetter) Factory
NewDeferredFactory create a factory that will only get KubeConfig until it is needed for the first time
func NewDelegateFactory ¶ added in v1.4.0
func NewDelegateFactory(clientGetter ClientGetter, configGetter ConfigGetter) Factory
NewDelegateFactory create a factory based on getter function
type FlagNoCompletionOption ¶ added in v1.4.0
type FlagNoCompletionOption struct{}
FlagNoCompletionOption disable auto-completion for flag
func (FlagNoCompletionOption) ApplyToClusterFlagOptions ¶ added in v1.4.0
func (option FlagNoCompletionOption) ApplyToClusterFlagOptions(cfg *ClusterFlagConfig)
ApplyToClusterFlagOptions .
func (FlagNoCompletionOption) ApplyToNamespaceFlagOptions ¶ added in v1.4.0
func (option FlagNoCompletionOption) ApplyToNamespaceFlagOptions(cfg *NamespaceFlagConfig)
ApplyToNamespaceFlagOptions .
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 NamespaceFlagOption ¶
type NamespaceFlagOption interface {
ApplyToNamespaceFlagOptions(*NamespaceFlagConfig)
}
NamespaceFlagOption the option for configuring namespace flag in cmd
type UsageOption ¶ added in v1.4.0
type UsageOption string
UsageOption the usage description for flag
func (UsageOption) ApplyToClusterFlagOptions ¶ added in v1.4.0
func (option UsageOption) ApplyToClusterFlagOptions(cfg *ClusterFlagConfig)
ApplyToClusterFlagOptions .
func (UsageOption) ApplyToNamespaceFlagOptions ¶ added in v1.4.0
func (option UsageOption) ApplyToNamespaceFlagOptions(cfg *NamespaceFlagConfig)
ApplyToNamespaceFlagOptions .