Documentation
¶
Overview ¶
Package deputy provides more advanced options for running commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deputy ¶
type Deputy struct { // Timeout represents the longest time the command will be allowed to run // before being killed. Timeout time.Duration // Errors describes how errors should be handled. Errors ErrorHandling // StdoutLog takes a function that will receive lines written to stdout from // the command (with the newline elided). StdoutLog func([]byte) // StdoutLog takes a function that will receive lines written to stderr from // the command (with the newline elided). StderrLog func([]byte) // contains filtered or unexported fields }
Deputy is a type that runs Commands with advanced options not available from os/exec. See the comments on field values for details.
type ErrorHandling ¶
type ErrorHandling int
ErrorHandling is a flag that tells Deputy how to handle errors running a command. See the values below for the different modes.
const ( // DefaultErrs represents the default handling of command errors - this // simply returns the error from Cmd.Run() DefaultErrs ErrorHandling = iota // FromStderr tells Deputy to convert the stderr output of a command into // the text of an error, if the command exits with an error. FromStderr // FromStdout tells Deputy to convert the stdout output of a command into // the text of an error, if the command exits with an error. FromStdout )
Click to show internal directories.
Click to hide internal directories.