Documentation
¶
Index ¶
- type Command
- func (c *Command) Close()
- func (c *Command) Context() context.Context
- func (c *Command) Env() *types.Env
- func (c *Command) LogFile() string
- func (c *Command) Logger() *zap.SugaredLogger
- func (c *Command) Name() string
- func (c *Command) OpenReport(format string) (*os.File, error)
- func (c *Command) OutputDir() string
- func (c *Command) WriteYAMLReport(r any)
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
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) Logger ¶
func (c *Command) Logger() *zap.SugaredLogger
func (*Command) OpenReport ¶ added in v0.16.0
OpenReport opens a report file for writing in the specified format.
func (*Command) WriteYAMLReport ¶ added in v0.16.0
WriteYAMLReport writes any report as YAML to the command output directory.