Documentation
¶
Index ¶
- func NormalizeExamples(examples string) string
- func PreRunE(cmd Command) func(*cobra.Command, []string) error
- func RunE(cmd Command) func(*cobra.Command, []string) error
- type ClassFiltered
- type Command
- type Context
- type Formatted
- type HasClassFlag
- type HasFormatFlags
- type HasNamespaceFlags
- type HasPlanFlag
- type HasScopedFlags
- type HasWaitFlags
- type Namespaced
- type PlanFiltered
- type Scoped
- type Waitable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeExamples ¶
NormalizeExamples removes leading and trailing empty lines from the command's Example string and normalizes the indentation so that all examples across all commands are indented consistently.
Types ¶
type ClassFiltered ¶
type ClassFiltered struct {
ClassFilter string
}
ClassFiltered adds support to a command for the --class flag.
func NewClassFiltered ¶
func NewClassFiltered() *ClassFiltered
NewClassFiltered initializes a new class specified command.
func (*ClassFiltered) AddClassFlag ¶
func (c *ClassFiltered) AddClassFlag(cmd *cobra.Command)
AddClassFlag adds the class related flag.
--class
func (*ClassFiltered) ApplyClassFlag ¶
func (c *ClassFiltered) ApplyClassFlag(cmd *cobra.Command) error
ApplyClassFlag persists the class related flag.
--class
type Command ¶
type Command interface {
// Validate and load the arguments passed to the svcat command.
Validate(args []string) error
// Run a validated svcat command.
Run() error
}
Command represents an svcat command.
type Context ¶
type Context struct {
// Output should be used instead of directly writing to stdout/stderr, to enable unit testing.
Output io.Writer
// svcat application, the library behind the cli
App *svcat.App
// Viper configuration
Viper *viper.Viper
}
Context is ambient data necessary to run any svcat command.
type Formatted ¶
type Formatted struct {
OutputFormat string
}
Formatted is the base command of all svcat commands that support customizable output formats.
func (*Formatted) AddOutputFlags ¶
AddOutputFlags adds common output flags to a command that can have variable output formats.
type HasClassFlag ¶
type HasClassFlag interface {
// ApplyClassFlag validates and persists the class related flag.
// --class
ApplyClassFlag(*cobra.Command) error
}
HasClassFlag represents a command that supports --class.
type HasFormatFlags ¶
type HasFormatFlags interface {
// ApplyFormatFlags persists the format-related flags:
// * --output
ApplyFormatFlags(lags *pflag.FlagSet) error
}
HasFormatFlags represents a command that can have its output formatted.
type HasNamespaceFlags ¶
type HasNamespaceFlags interface {
Command
// ApplyNamespaceFlags persists the namespace-related flags:
// * --namespace
// * --all-namespaces
ApplyNamespaceFlags(flags *pflag.FlagSet)
}
HasNamespaceFlags represents a command that can be scoped to a namespace.
type HasPlanFlag ¶
type HasPlanFlag interface {
// ApplyPlanFlag validates and persists the plan related flag.
// --plan
ApplyPlanFlag(*cobra.Command) error
}
HasPlanFlag represents a command that supports --plan.
type HasScopedFlags ¶
type HasScopedFlags interface {
// ApplyScopedFlags persists the scope related flags:
// * --cluster
ApplyScopedFlags(flags *pflag.FlagSet) error
}
HasScopedFlags represents a command that can be scoped to either namespace level or cluster level resources.
type HasWaitFlags ¶
type HasWaitFlags interface {
// ApplyWaitFlags validates and persists the wait related flags.
// --wait
// --timeout
// --interval
ApplyWaitFlags() error
}
HasWaitFlags represents a command that supports --wait.
type Namespaced ¶
Namespaced is the base command of all svcat commands that are namespace scoped.
func (*Namespaced) AddNamespaceFlags ¶
func (c *Namespaced) AddNamespaceFlags(flags *pflag.FlagSet, allowAll bool)
AddNamespaceFlags adds the namespace-related flags: * --namespace * --all-namespaces
func (*Namespaced) ApplyNamespaceFlags ¶
func (c *Namespaced) ApplyNamespaceFlags(flags *pflag.FlagSet)
ApplyNamespaceFlags persists the namespace-related flags: * --namespace * --all-namespaces
type PlanFiltered ¶
type PlanFiltered struct {
PlanFilter string
}
PlanFiltered adds support to a command for the --plan flag.
func NewPlanFiltered ¶
func NewPlanFiltered() *PlanFiltered
NewPlanFiltered initializes a new plan specified command.
func (*PlanFiltered) AddPlanFlag ¶
func (c *PlanFiltered) AddPlanFlag(cmd *cobra.Command)
AddPlanFlag adds the plan related flag.
--plan
func (*PlanFiltered) ApplyPlanFlag ¶
func (c *PlanFiltered) ApplyPlanFlag(cmd *cobra.Command) error
ApplyPlanFlag persists the plan related flag.
--plan
type Scoped ¶
type Scoped struct {
Scope servicecatalog.Scope
// contains filtered or unexported fields
}
Scoped is the base command of all svcat commands that can be scoped to either namespace level or cluster level resources.
func (*Scoped) AddScopedFlags ¶
AddScopedFlags adds the scope-related flags. * --scope
type Waitable ¶
type Waitable struct {
Wait bool
Timeout *time.Duration
Interval time.Duration
// contains filtered or unexported fields
}
Waitable adds support to a command for the --wait flags.
func (*Waitable) AddWaitFlags ¶
AddWaitFlags adds the wait related flags.
--wait --timeout --interval
func (*Waitable) ApplyWaitFlags ¶
ApplyWaitFlags validates and persists the wait related flags.
--wait --timeout --interval