subprocess

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package subprocess provides implementations for running subprocesses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	// Dir is the working directory of the subprocesses; if unspecified, that
	// of the current process will be used.
	Dir string

	// Env is the environment of the subprocess, following the usual convention of a list of
	// strings of the form "<environment variable name>=<value>".
	Env []string
}

Runner is a Runner that runs commands as local subprocesses.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, command []string, stdout io.Writer, stderr io.Writer) error

Run runs a command until completion or until a context is canceled, in which case the subprocess is killed so that no subprocesses it spun up are orphaned.

func (*Runner) RunWithStdin

func (r *Runner) RunWithStdin(ctx context.Context, command []string, stdout io.Writer, stderr io.Writer, stdin io.Reader) error

RunWithStdin operates identically to Run, but additionally pipes input to the process via stdin.

Jump to

Keyboard shortcuts

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