execwrapper

package
v0.0.0-...-fb1fb40 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd interface {
	Run() error
	Start() error
	Wait() error
	KillProcess() error
	AppendExtraFiles(...*os.File)
	Args() []string
	SetIOStreams(io.Reader, io.Writer, io.Writer)
	Output() ([]byte, error)
	CombinedOutput() ([]byte, error)
}

Cmd acts as a wrapper to functions exposed by the exec.Cmd object. Having this interface enables us to create mock objects we can use for testing.

func NewCMD

func NewCMD(name string, arg ...string) Cmd

NewCMDContext returns a new cmdWrapper object which will be used to call standard go os exec calls

func NewCMDContext

func NewCMDContext(ctx context.Context, name string, arg ...string) Cmd

NewCMDContext returns a new cmdWrapper object which will be used to call standard go os exec calls with a context

type Exec

type Exec interface {
	CommandContext(ctx context.Context, name string, arg ...string) Cmd
	ConvertToExitError(err error) (*exec.ExitError, bool)
	GetExitCode(exitErr *exec.ExitError) int
	NewExecContextWithTimeout(parent context.Context, duration time.Duration) (context.Context, context.CancelFunc)
}

Exec acts as a wrapper to functions exposed by the exec package. Having this interface enables us to create mock objects we can use for testing.

func NewExec

func NewExec() Exec

Directories

Path Synopsis
Package mock_execwrapper is a generated GoMock package.
Package mock_execwrapper is a generated GoMock package.

Jump to

Keyboard shortcuts

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