exec

package
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

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

func (s *Streaming) Exec() error

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()

func (*Streaming) Signal added in v0.34.0

func (s *Streaming) Signal(signal os.Signal) error

Signal enables spawned subprocess to accept given signal.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL