Documentation
¶
Overview ¶
Package cmd provides a more domain-specific layer over exec.Cmd.
Index ¶
Constants ¶
const (
// Shell will have the command line passed to its `-c` option.
Shell = "/bin/bash"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
func NewCommand ¶
NewCommand returns a Cmd with IO configured, but not started.
func (*Cmd) StartWithStdin ¶
Start the process, write input to stdin, then close stdin.
func (*Cmd) Terminate ¶
Terminate the process with SIGTERM. TODO: follow up with SIGKILL if still running.
func (*Cmd) WaitChan ¶
func (cmd *Cmd) WaitChan() <-chan WaitResult
WaitChan starts a goroutine to wait for the command to exit, and returns a channel over which will be sent the WaitResult, containing either the exit status (0 for success) or a non-exit error, e.g. IO error.
type WaitResult ¶
WaitResult is sent to the channel returned by WaitChan(). It indicates the exit status, or a non-exit-status error e.g. IO error. In the case of a non-exit-status, Status is -1