Documentation ¶
Overview ¶
package cli provides wrapper support for executing commands, this is so we can test the rest of the implementations quickly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cli ¶
type Cli struct {
// contains filtered or unexported fields
}
Cli
func (*Cli) ExecuteAndStreamOutput ¶
func (c *Cli) ExecuteAndStreamOutput(outputHandler OutputHandler, args ...string) error
ExecuteAndStreamOutput runs a system command and streams the output (stdout) and errors (stderr) to the provided output handler function. This function will run the command specified by the args parameters. The first arg should be the command itself, and the rest of the args should be its parameters. The outputHandler is a callback function that is called with each line of output and error from the command. If the command runs successfully, the function will return nil. If there's an error executing the command, it will return an error. Note that an error from the command itself (e.g., a non-zero exit status) will also be returned as an error from this function.
type CmdExecutor ¶
type ExecuteCliErr ¶
type OutputHandler ¶
type OutputHandler func(line string)
OutputHandler is a function type that processes lines of output
type UnableToStartErr ¶
func (UnableToStartErr) Error ¶
func (u UnableToStartErr) Error() string