Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct { Binary string Path string Args []string Stderr io.Writer Stdout io.Writer Logger *log.Entry // contains filtered or unexported fields }
A CLI defines the structure that will be used for the Cmd interface. It's composed by:
- Binary: The name of the binary that will be executed.
- Path: The path of the binary that will be executed.
- Args: A list of strings that will be passed as arguments to the command executed.
- Stderr: An interface that will be used to write the stderr.
- Stdout: An interface that will be used to write the stdout.
- Logger: The apex log entry.
- stderrString: The stderr in a string format, used only internally.
func (*CLI) Initialize ¶
Initialize sets the struct attributes necessary to execute the command.
type Cmd ¶
A Cmd defines an interface to execute some operations with os/exec. Is composed by:
- Initialize: It will do what's necessary to be able to run a command, like set the stdout or the logger.
- Run: It will run the command, duh.
- GetStderr: It will return the stderr of the command. It's usually used to determinate if an error is really an error in particle.
Click to show internal directories.
Click to hide internal directories.