Documentation ¶
Overview ¶
Package cmd provides support for running commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandRunner ¶
type CommandRunner interface {
RunCommand(ctx context.Context, stdoutBuf, stderrBuf *bytes.Buffer, dir, name string, args ...string) error
}
CommandRunner is the common interface for this module.
type FakeCommandRunner ¶
type FakeCommandRunner struct { Stdout string Stderr string // Only one of ExpectedCmd and ExpectedCmdPartial can be set. ExpectedCmd []string ExpectedCmdPartial []string ExpectedDir string FailCommand bool FailError string }
FakeCommandRunner does not actually run commands. It is used for testing.
func (FakeCommandRunner) RunCommand ¶
func (c FakeCommandRunner) RunCommand(ctx context.Context, stdoutBuf, stderrBuf *bytes.Buffer, dir, name string, args ...string) error
RunCommand runs a command (not actually).
type FakeCommandRunnerMulti ¶
type FakeCommandRunnerMulti struct { CommandRunners []FakeCommandRunner // contains filtered or unexported fields }
FakeCommandRunnerMulti provides multiple command runners.
func (*FakeCommandRunnerMulti) RunCommand ¶
func (c *FakeCommandRunnerMulti) RunCommand(ctx context.Context, stdoutBuf, stderrBuf *bytes.Buffer, dir, name string, args ...string) error
RunCommand runs a command (not actually).
type RealCommandRunner ¶
type RealCommandRunner struct{}
RealCommandRunner actually runs commands.
func (RealCommandRunner) RunCommand ¶
func (c RealCommandRunner) RunCommand(ctx context.Context, stdoutBuf, stderrBuf *bytes.Buffer, dir, name string, args ...string) error
RunCommand runs a command.
Click to show internal directories.
Click to hide internal directories.