command

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command is a ramenctl generic command used by all ramenctl commands. Note that the config is not part of the command since test commands use extended configuration.

func ForTest added in v0.5.0

func ForTest(
	commandName string,
	env *types.Env,
	outputDir string,
) (*Command, error)

ForTest is a command configured for testing without real clusters. This command does not handle signals and its context cannot be cancelled.

func New

func New(
	commandName string,
	clusters map[string]e2econfig.Cluster,
	outputDir string,
) (*Command, error)

New creates a new command handling os.Interrupt signal. To close the log and stop the signal handler call Close().

func (*Command) Close added in v0.5.0

func (c *Command) Close()

Close log and stop handling signals and mark the command context as done. Calling while a command is running will cancel the command.

func (*Command) Context added in v0.5.0

func (c *Command) Context() context.Context

func (*Command) Env

func (c *Command) Env() *types.Env

func (*Command) LogFile added in v0.11.0

func (c *Command) LogFile() string

func (*Command) Logger

func (c *Command) Logger() *zap.SugaredLogger

func (*Command) Name

func (c *Command) Name() string

func (*Command) OpenReport added in v0.16.0

func (c *Command) OpenReport(format string) (*os.File, error)

OpenReport opens a report file for writing in the specified format.

func (*Command) OutputDir

func (c *Command) OutputDir() string

func (*Command) WriteYAMLReport added in v0.16.0

func (c *Command) WriteYAMLReport(r any)

WriteYAMLReport writes any report as YAML to the command output directory.

Jump to

Keyboard shortcuts

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