exec

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 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 {
	Command string
	Args    []string
	Env     []string
	Output  io.Writer
	Timeout time.Duration
	// contains filtered or unexported fields
}

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