Documentation ¶
Index ¶
- Constants
- Variables
- func AllNamespacesFlag(cmd *cobra.Command, c *Config, namespace *string, allNamespaces *bool)
- func Args(cmd *cobra.Command, argDefs ...Arg)
- func CommandFromContext(ctx context.Context) *cobra.Command
- func DryRunResource(ctx context.Context, resource runtime.Object, gvk schema.GroupVersionKind)
- func ExecOptions(ctx context.Context, c *Config, opts Executable) func(cmd *cobra.Command, args []string) error
- func FormatArgs(cmd *cobra.Command) string
- func FormatConditionStatus(cond *apis.Condition) string
- func FormatEmptyString(str string) string
- func FormatTimestampSince(timestamp metav1.Time, now time.Time) string
- func NamespaceFlag(cmd *cobra.Command, c *Config, namespace *string)
- func PrintResourceStatus(c *Config, name string, condition *apis.Condition)
- func ReadStdin(c *Config, value *[]byte, prompt string) func(*cobra.Command, []string) error
- func Sequence(items ...func(cmd *cobra.Command, args []string) error) func(*cobra.Command, []string) error
- func Serrorf(format string, a ...interface{}) string
- func Sfaintf(format string, a ...interface{}) string
- func SilenceError(err error) error
- func Sinfof(format string, a ...interface{}) string
- func SortByNamespaceAndName(s interface{})
- func Ssuccessf(format string, a ...interface{}) string
- func StripDash(flagName string) string
- func Swarnf(format string, a ...interface{}) string
- func ValidateOptions(ctx context.Context, opts Validatable) func(cmd *cobra.Command, args []string) error
- func Visit(cmd *cobra.Command, f func(c *cobra.Command) error) error
- func WithCommand(ctx context.Context, cmd *cobra.Command) context.Context
- type Arg
- type CompiledEnv
- type Config
- func (c *Config) Eerrorf(format string, a ...interface{}) (n int, err error)
- func (c *Config) Einfof(format string, a ...interface{}) (n int, err error)
- func (c *Config) Eprintf(format string, a ...interface{}) (n int, err error)
- func (c *Config) Errorf(format string, a ...interface{}) (n int, err error)
- func (c *Config) Esuccessf(format string, a ...interface{}) (n int, err error)
- func (c *Config) Infof(format string, a ...interface{}) (n int, err error)
- func (c *Config) Printf(format string, a ...interface{}) (n int, err error)
- func (c *Config) Successf(format string, a ...interface{}) (n int, err error)
- type DryRunable
- type Executable
- type FieldErrors
- type Validatable
Constants ¶
View Source
const ( NameArgumentName = "name" NamesArgumentName = "name(s)" )
View Source
const ( TailSinceCreateDefault = time.Minute TailSinceDefault = time.Second )
View Source
const ( AllFlagName = "--all" AllNamespacesFlagName = "--all-namespaces" ApplicationRefFlagName = "--application-ref" ArtifactFlagName = "--artifact" BootstrapServersFlagName = "--bootstrap-servers" CacheSizeFlagName = "--cache-size" ContainerConcurrencyFlagName = "--container-concurrency" ConfigFlagName = "--config" ConfigurationRefFlagName = "--configuration-ref" ContainerRefFlagName = "--container-ref" ContentTypeFlagName = "--content-type" DefaultImagePrefixFlagName = "--default-image-prefix" DirectoryFlagName = "--directory" DockerHubFlagName = "--docker-hub" DryRunFlagName = "--dry-run" EnvFlagName = "--env" EnvFromFlagName = "--env-from" FunctionRefFlagName = "--function-ref" GatewayFlagName = "--gateway" GcrFlagName = "--gcr" GitRepoFlagName = "--git-repo" GitRevisionFlagName = "--git-revision" HandlerFlagName = "--handler" ImageFlagName = "--image" IngressPolicyFlagName = "--ingress-policy" InputFlagName = "--input" InvokerFlagName = "--invoker" KubeConfigFlagName = "--kubeconfig" KubeConfigFlagNameDeprecated = "--kube-config" LimitCPUFlagName = "--limit-cpu" LimitMemoryFlagName = "--limit-memory" LocalPathFlagName = "--local-path" MaxScaleFlagName = "--max-scale" MinScaleFlagName = "--min-scale" NamespaceFlagName = "--namespace" NoColorFlagName = "--no-color" OutputFlagName = "--output" RegistryFlagName = "--registry" RegistryUserFlagName = "--registry-user" ServiceRefFlagName = "--service-ref" ServiceURLFlagName = "--service-url" SetDefaultImagePrefixFlagName = "--set-default-image-prefix" ShellFlagName = "--shell" SinceFlagName = "--since" SubPathFlagName = "--sub-path" TailFlagName = "--tail" TargetPortFlagName = "--target-port" WaitTimeoutFlagName = "--wait-timeout" )
View Source
const ( CoreRuntime = "core" StreamingRuntime = "streaming" KnativeRuntime = "knative" )
View Source
const CurrentField = validation.CurrentField
Variables ¶
View Source
var ( FaintColor = color.New(color.Faint) InfoColor = color.New(color.FgCyan) SuccessColor = color.New(color.FgGreen) WarnColor = color.New(color.FgYellow) ErrorColor = color.New(color.FgRed) )
View Source
var ( ErrDisallowedFields = validation.ErrDisallowedFields ErrInvalidArrayValue = validation.ErrInvalidArrayValue ErrInvalidValue = validation.ErrInvalidValue ErrMissingField = validation.ErrMissingField ErrMissingOneOf = validation.ErrMissingOneOf ErrMultipleOneOf = validation.ErrMultipleOneOf )
View Source
var AllRuntimes = []string{CoreRuntime, StreamingRuntime, KnativeRuntime}
View Source
var ErrIgnoreArg = fmt.Errorf("ignore argument")
View Source
var SilentError = &silentError{}
Functions ¶
func AllNamespacesFlag ¶
func DryRunResource ¶
func ExecOptions ¶
func ExecOptions(ctx context.Context, c *Config, opts Executable) func(cmd *cobra.Command, args []string) error
ExecOptions bridges a cobra RunE function to the Executable interface. All flags and arguments must already be bound, with explicit or default values, to the options struct being validated. This function is typically used to define the RunE phase of a command.
```
cmd := &cobra.Command{ ... RunE: cli.ExecOptions(c, opts), }
```
func FormatArgs ¶
func FormatConditionStatus ¶
func FormatEmptyString ¶
func PrintResourceStatus ¶
func SilenceError ¶
func SortByNamespaceAndName ¶
func SortByNamespaceAndName(s interface{})
func ValidateOptions ¶
func ValidateOptions(ctx context.Context, opts Validatable) func(cmd *cobra.Command, args []string) error
ValidateOptions bridges a cobra RunE function to the Validatable interface. All flags and arguments must already be bound, with explicit or default values, to the options struct being validated. This function is typically used to define the PreRunE phase of a command.
```
cmd := &cobra.Command{ ... PreRunE: cli.ValidateOptions(opts), }
```
Types ¶
type Arg ¶
type Arg struct { Name string Arity int Optional bool Set func(cmd *cobra.Command, args []string, offset int) error }
func BareDoubleDashArgs ¶
type CompiledEnv ¶
type Config ¶
type Config struct { CompiledEnv ViperConfigFile string KubeConfigFile string k8s.Client Exec func(ctx context.Context, command string, args ...string) *exec.Cmd Pack pack.Client Kail kail.Logger Stdin io.Reader Stdout io.Writer Stderr io.Writer }
func Initialize ¶
func Initialize() *Config
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type DryRunable ¶
type DryRunable interface {
IsDryRun() bool
}
type FieldErrors ¶ added in v0.5.0
type FieldErrors = validation.FieldErrors
type Validatable ¶
type Validatable = validation.Validatable
Source Files ¶
Click to show internal directories.
Click to hide internal directories.