Documentation
¶
Overview ¶
Package exec contains helper abstractions for working with external commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Streaming ¶
type Streaming struct {
Args []string
Command string
Env []string
Output io.Writer
Process *os.Process
Progress io.Writer
SignalCh chan os.Signal
Timeout time.Duration
Verbose bool
}
Streaming models a generic command execution that consumers can use to execute commands and stream their output to an io.Writer. For example compute commands can use this to standardize the flow control for each compiler toolchain.
func (*Streaming) Exec ¶
Exec executes the compiler command and pipes the child process stdout and stderr output to the supplied io.Writer, it waits for the command to exit cleanly or returns an error.
func (*Streaming) MonitorSignals ¶ added in v0.34.0
func (s *Streaming) MonitorSignals()
MonitorSignals spawns a goroutine that configures signal handling so that the long running subprocess can be killed using SIGINT/SIGTERM.
func (*Streaming) MonitorSignalsAsync ¶ added in v1.1.0
func (s *Streaming) MonitorSignalsAsync()
Click to show internal directories.
Click to hide internal directories.