groupswitch

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 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 for switching the default resource group scope of a workspace, which takes in a factory object and returns a cobra command and a runner object.

Types

type Runner

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

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

func NewRunner

func NewRunner(factory framework.Factory) *Runner

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

func (*Runner) Run

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

Run checks if the resource group specified in the request object exists, and if it does, adds the workspace to the configuration file. If the resource group does not exist, an error is returned.

func (*Runner) Validate

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

Validate checks if the workspace is editable, requires a UCP resource group and sets the workspace and UCP resource group name in the Runner struct. It returns an error if any of these checks fail.

Jump to

Keyboard shortcuts

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