Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner controls the SubCommand workflow from end-to-end.
func NewRunner ¶
func NewRunner(cfg *config.Config, subCommand SubCommand) *Runner
NewRunner instantiates a Runner, making sure it's RunE command is mapped to the local method, which executes the whole interface workflow.
type SubCommand ¶
type SubCommand interface { // Cmd exposes the SubCommand's cobra command instance. Cmd() *cobra.Command // Complete should load the required information, arguments, kubernetes resources, etc. Complete(_ *config.Config, _ []string) error // Validate should validate before "run". Validate() error // Run performs the primary business logic. Run(_ *config.Config) error }
SubCommand wraps a cobra command with "business" logic, providing a sequence of actions to perform the intended workflow.
Click to show internal directories.
Click to hide internal directories.