Documentation ¶
Overview ¶
Package cmd holds the root command and all sub-commands, wiring them up together. This package also implements kubectl/oc component workflow via SubCommand interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options global options informed to the command-line, includes generic kubectl flags. This should contain all information needed for instantiating a API client.
func NewOptions ¶
func NewOptions() *Options
NewOptions instantiate options and kubectl generic flags.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner execute the sub-command lifecycle, wrapper around sub-commands.
func NewRunner ¶
func NewRunner(opts *Options, ioStreams genericclioptions.IOStreams, subCmd SubCommand) *Runner
NewRunner instantiate a Runner.
type SubCommand ¶
type SubCommand interface { // Cmd shares the cobra.Command instance. Cmd() *cobra.Command // Complete aggregate data needed for the sub-command primary logic. Complete(client dynamic.Interface, ns string, args []string) error // Validate perform validation against the context collected. Validate() error // Run execute the primary sub-command logic. Run(client dynamic.Interface, ns string) error }
SubCommand defines the methods for a sub-command wrapped with Runner.
Click to show internal directories.
Click to hide internal directories.