Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
Cmd is a command with a streamline.Stream attached to it.
func Attach ¶
func Attach(cmd *exec.Cmd, mode StreamMode) *Cmd
Run attaches a streamline.Stream to the command, returning a wrapped Cmd that can be configured with pipeline.Pipeline and run with (*Cmd).Run(...).
Output piping is handled by buffers created by streamline/pipe.NewStream(...).
func (*Cmd) Start ¶
func (c *Cmd) Start() (*streamline.Stream, error)
Start starts a command and returns an error if the command fails to start. It also starts a goroutine that waits for command completion and stops the pipe appropriately.
It always returns a valid Stream that can be used to collect output from the underlying command.
type StreamMode ¶
type StreamMode int
StreamMode indicates what output(s) to attach.
const ( // Combined streams both Stdout and Stderr. Combined StreamMode = Stdout | Stderr // Stdout only streams cmd.Stdout. Stdout StreamMode = 1 << iota // Stderr only streams cmd.Stderr. Stderr // ErrorWithStderr collects Stderr output and includes it in the returned error from // Cmd.Start(). Best used with the Stdout StreamMode. ErrorWithStderr )
Click to show internal directories.
Click to hide internal directories.