destroy

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdDestroy

func NewCmdDestroy(ui *terminal.UI, ioStreams genericiooptions.IOStreams) *cobra.Command

NewCmdDestroy creates the `delete` command.

Types

type DeleteFlags

type DeleteFlags struct {
	MetaFlags *meta.MetaFlags

	Operator string
	Yes      bool
	Detail   bool
	NoStyle  bool

	UI *terminal.UI

	genericiooptions.IOStreams
}

DeleteFlags directly reflect the information that CLI is gathering via flags. They will be converted to DestroyOptions, which reflect the runtime requirements for the command.

This structure reduces the transformation to wiring and makes the logic itself easy to unit test.

func NewDeleteFlags

func NewDeleteFlags(ui *terminal.UI, streams genericiooptions.IOStreams) *DeleteFlags

NewDeleteFlags returns a default DeleteFlags

func (*DeleteFlags) AddFlags

func (flags *DeleteFlags) AddFlags(cmd *cobra.Command)

AddFlags registers flags for a cli.

func (*DeleteFlags) ToOptions

func (flags *DeleteFlags) ToOptions() (*DestroyOptions, error)

ToOptions converts from CLI inputs to runtime inputs.

type DestroyOptions

type DestroyOptions struct {
	*meta.MetaOptions

	Yes     bool
	Detail  bool
	NoStyle bool

	UI *terminal.UI

	genericiooptions.IOStreams
}

DestroyOptions defines flags and other configuration parameters for the `delete` command.

func (*DestroyOptions) Run

func (o *DestroyOptions) Run() (err error)

Run executes the `delete` command.

func (*DestroyOptions) Validate

func (o *DestroyOptions) Validate(cmd *cobra.Command, args []string) error

Validate verifies if DestroyOptions are valid and without conflicts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL