process

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package process implements process utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Control

type Control struct {
	Timeout   time.Duration
	Interrupt *time.Timer
	Terminate *time.Timer
	// contains filtered or unexported fields
}

Control can commands until a timeout is reached, at which point it signals and then terminates them.

func NewControl

func NewControl(timeout time.Duration, interrupt, terminate *time.Timer, verbose bool) *Control

NewControl constructs a Control with the specified arguments, instiating other necessary fields.

func (*Control) FinishRunning

func (c *Control) FinishRunning(cmd *exec.Cmd) error

FinishRunning returns cmd.Wait() and/or times out.

func (*Control) FinishRunningParallel

func (c *Control) FinishRunningParallel(cmds ...*exec.Cmd) error

FinishRunningParallel executes multiple commands in parallel

func (*Control) InputCommand

func (c *Control) InputCommand(input, cmd string, args ...string) (*exec.Cmd, error)

InputCommand returns exec.Command(cmd, args...) while calling .StdinPipe().WriteString(input)

func (*Control) NoOutput

func (c *Control) NoOutput(cmd *exec.Cmd) error

NoOutput ignores all output from the command, potentially timing out in the process.

func (*Control) Output

func (c *Control) Output(cmd *exec.Cmd) ([]byte, error)

Output returns cmd.Output(), potentially timing out in the process.

Jump to

Keyboard shortcuts

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