cmdrunner

package
v0.0.0-...-f7ae98d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureOutputMode

type CaptureOutputMode int
const (
	CaptureOutputModeCombined CaptureOutputMode = iota
	CaptureOutputModeStdout
)

type CmdRunner

type CmdRunner interface {

	// Run runs a command, given runOptions
	Run(runOptions *RunOptions, format string, vars ...interface{}) (RunResult, error)
}

CmdRunner specifies the interface to an underlying command runner

type RunOptions

type RunOptions struct {
	WorkingDir        *string
	Stdin             *string
	Env               map[string]string
	LogRedactions     []string
	CaptureOutputMode CaptureOutputMode
}

RunOptions specifies runOptions to CmdRunner.Run

type RunResult

type RunResult struct {
	Output   string
	Stderr   string
	ExitCode int
}

type ShellRunner

type ShellRunner struct {
	// contains filtered or unexported fields
}

func NewShellRunner

func NewShellRunner(parentLogger logger.Logger) (*ShellRunner, error)

func (*ShellRunner) Run

func (sr *ShellRunner) Run(runOptions *RunOptions, format string, vars ...interface{}) (RunResult, error)

func (*ShellRunner) SetShell

func (sr *ShellRunner) SetShell(shell string)

Jump to

Keyboard shortcuts

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