delete

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 10 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 that can be used to delete an environment, with options to specify the environment name, resource group, workspace, output format, and confirmation prompt.

Types

type Runner

type Runner struct {
	ConfigHolder      *framework.ConfigHolder
	ConnectionFactory connections.Factory
	Workspace         *workspaces.Workspace
	Output            output.Interface
	InputPrompter     prompt.Interface

	Confirm         bool
	EnvironmentName string
	Format          string
}

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

func NewRunner

func NewRunner(factory framework.Factory) *Runner

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

func (*Runner) Run

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

Run prompts the user to confirm the deletion of an environment, creates an applications management client, and deletes the environment if confirmed. It returns an error if the prompt or client creation fails.

func (*Runner) Validate

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

Validate takes in a command and a slice of strings and sets the workspace, scope, environment name, confirmation and output format of the runner based on the command and the strings. It returns an error if any of these values cannot be set.

Jump to

Keyboard shortcuts

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