sh

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cmd string, options ...RunOption) (int, error)

Run provides a functional API for running a process Default Behaviors: stdout, stderr, stdin are sent to /dev/null all environment variables are passed to subprocess additionally, you may add vars to RunOptions.Env

Returns the exitCode and error The error turned will only be non-nil if the process failed to start for some reason

Types

type CmdRunner

type CmdRunner func(ctx context.Context, cmd string, options ...RunOption) (int, error)

CmdRunner describes the signature of the Run function

type RunOption

type RunOption func(o *RunOptions)

RunOption is part of the functional API for Run

type RunOptions

type RunOptions struct {
	Args   []string
	Env    map[string]string
	Stdout io.Writer
	Stderr io.Writer
	Stdin  io.Reader
}

RunOptions is part of the functional API for Run

Jump to

Keyboard shortcuts

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