exec

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package exec is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

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

Cmd runs external commands, it wraps the exec.Command function from the stdlib so that running external commands can be unit tested.

func NewCmd

func NewCmd() *Cmd

NewCmd returns a Cmd that can run external commands.

func (*Cmd) InteractiveRun

func (c *Cmd) InteractiveRun(name string, args ...string) error

InteractiveRun runs the input command that starts a child process.

func (*Cmd) Run

func (c *Cmd) Run(name string, args []string, opts ...CmdOption) error

Run starts the named command and waits until it finishes.

type CmdOption

type CmdOption func(cmd *exec.Cmd)

CmdOption is a type alias to configure a command.

func Stderr

func Stderr(writer io.Writer) CmdOption

Stderr sets the internal *exec.Cmd's Stderr field.

func Stdin

func Stdin(r io.Reader) CmdOption

Stdin sets the internal *exec.Cmd's Stdin field.

func Stdout

func Stdout(writer io.Writer) CmdOption

Stdout sets the internal *exec.Cmd's Stdout field.

type MockcmdRunner

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

MockcmdRunner is a mock of cmdRunner interface.

func NewMockcmdRunner

func NewMockcmdRunner(ctrl *gomock.Controller) *MockcmdRunner

NewMockcmdRunner creates a new mock instance.

func (*MockcmdRunner) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockcmdRunner) Run

func (m *MockcmdRunner) Run() error

Run mocks base method.

type MockcmdRunnerMockRecorder

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

MockcmdRunnerMockRecorder is the mock recorder for MockcmdRunner.

func (*MockcmdRunnerMockRecorder) Run

Run indicates an expected call of Run.

Jump to

Keyboard shortcuts

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