list

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 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 and a Runner to list resources of a specified type in an application or the default environment, and adds flags for application name, resource group, output and workspace.

Types

type Runner

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

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

func NewRunner

func NewRunner(factory framework.Factory) *Runner

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

func (*Runner) Run

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

Run checks if an application name is provided and if so, checks if the application exists in the workspace, then lists all resources of the specified type in the application, and finally writes the resources to the output in the specified format. If no application name is provided, it lists all resources of the specified type. An error is returned if the application does not exist in the workspace.

func (*Runner) Validate

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

Validate checks the command line args, workspace, scope, application name, resource type and output format, and returns an error if any of these are invalid.

Jump to

Keyboard shortcuts

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