delete

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner)

NewCommand creates a new cobra command for deleting a Radius resource, with flags for output, workspace, resource group,

and confirmation. It returns the command and a Runner to execute the command.

Types

type Runner

type Runner struct {
	ConfigHolder      *framework.ConfigHolder
	ConnectionFactory connections.Factory
	Output            output.Interface
	Workspace         *workspaces.Workspace
	ResourceType      string
	ResourceName      string
	Format            string

	InputPrompter prompt.Interface
	Confirm       bool
}

Runner is the runner implementation for the `rad resource delete` command.

func NewRunner

func NewRunner(factory framework.Factory) *Runner

NewRunner creates a new instance of the `rad resource delete` runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) error

Run checks if the user has confirmed the deletion of the resource, and if so, attempts to delete the resource and logs the result. If an error occurs, it is returned.

func (*Runner) Validate

func (r *Runner) Validate(cmd *cobra.Command, args []string) error

Validate checks the workspace, scope, resource type and name, output format, and confirmation flag from the command line arguments and sets them in the Runner struct. It returns an error if any of these values are invalid.

Jump to

Keyboard shortcuts

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