appswitch

package
v0.26.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 11 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 switching the default Radius Application, which takes in a factory and returns a cobra command and a runner.

Types

type Runner

type Runner struct {
	ConfigHolder      *framework.ConfigHolder
	Output            output.Interface
	Workspace         *workspaces.Workspace
	ApplicationName   string
	ConnectionFactory connections.Factory
}

Runner is the runner implementation for the `rad app switch` command.

func NewRunner

func NewRunner(factory framework.Factory) *Runner

NewRunner creates a new instance of the `rad app switch` runner.

func (*Runner) Run

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

The function Run takes in a context and updates the configuration of the workspace with the given application name, and returns an error if any.

func (*Runner) Validate

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

Validate checks if the workspace is editable, reads the application name from the command line arguments, checks if the application exists. It returns an error if the workspace is not editable, if the application name is not provided, or if the application does not exist.

Jump to

Keyboard shortcuts

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