list

package
v0.26.8 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 9 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 listing local workspaces and returns a Runner to execute the command.

Types

type Runner

type Runner struct {
	ConfigHolder *framework.ConfigHolder
	Output       output.Interface
	Format       string
}

Runner is the runner implementation for the `rad workspace list` command.

func NewRunner

func NewRunner(factory framework.Factory) *Runner

NewRunner creates a new instance of the `rad workspace list` runner.

func (*Runner) Run

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

Run reads the workspace section from the config, puts the workspace names in alphabetical order, creates a slice of workspaces, and then writes the formatted workspaces to the output. It returns an error if any of these steps fail.

func (*Runner) Validate

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

Validate checks the output format of the command and sets the format in the Runner struct, returning an error if the output format is invalid.

Jump to

Keyboard shortcuts

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