Documentation ¶
Index ¶
- func Command(command ...string) *exec.Cmd
- func CommandContext(ctx context.Context, command ...string) *exec.Cmd
- func FullOutput(c *exec.Cmd) (stdout []byte, stderr []byte, code int, err error)
- func SimpleFullOutput(timeout time.Duration, command ...string) (stdout []byte, stderr []byte, code int, err error)
- type CommandExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandContext ¶
CommandContext returns a Cmd with the given context and shell command.
func FullOutput ¶
FullOutput runs a command and returns its stdout, stderr, exit code, and error status.
Types ¶
type CommandExecutor ¶
type CommandExecutor struct { Done chan error // contains filtered or unexported fields }
CommandExecutor is a structure returned by exec.Run Cancel can be used by a user to interrupt a command execution. Done is a channel the user can read in order to retrieve execution status. Possible statuses:
<nil> command executed successfully, returned 0 exit code <exit status N> where N is non 0 exit status. <context deadline exceeded> means timeout was reached and command was killed. <context canceled> means that command was canceled by a user.
Click to show internal directories.
Click to hide internal directories.