execwrapper

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: pkg/perf/iperf/exec_wrapper.go

Generated by this command:

mockgen -source=pkg/perf/iperf/exec_wrapper.go -destination=pkg/perf/iperf/mock_exec_wrapper.go -package=iperf

Package execwrapper is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecCmd

type ExecCmd interface {
	CombinedOutput() ([]byte, error)
}

ExecCmd represents a command that can be executed

type ExecWrapper

type ExecWrapper interface {
	LookPath(file string) (string, error)
	CommandContext(ctx context.Context, name string, arg ...string) ExecCmd
}

ExecWrapper wraps the exec package functions to allow for mocking

type MockExecCmd

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

MockExecCmd is a mock of ExecCmd interface.

func NewMockExecCmd

func NewMockExecCmd(ctrl *gomock.Controller) *MockExecCmd

NewMockExecCmd creates a new mock instance.

func (*MockExecCmd) CombinedOutput

func (m *MockExecCmd) CombinedOutput() ([]byte, error)

CombinedOutput mocks base method.

func (*MockExecCmd) EXPECT

func (m *MockExecCmd) EXPECT() *MockExecCmdMockRecorder

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

type MockExecCmdMockRecorder

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

MockExecCmdMockRecorder is the mock recorder for MockExecCmd.

func (*MockExecCmdMockRecorder) CombinedOutput

func (mr *MockExecCmdMockRecorder) CombinedOutput() *gomock.Call

CombinedOutput indicates an expected call of CombinedOutput.

type MockExecWrapper

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

MockExecWrapper is a mock of ExecWrapper interface.

func NewMockExecWrapper

func NewMockExecWrapper(ctrl *gomock.Controller) *MockExecWrapper

NewMockExecWrapper creates a new mock instance.

func (*MockExecWrapper) CommandContext

func (m *MockExecWrapper) CommandContext(ctx context.Context, name string, arg ...string) ExecCmd

CommandContext mocks base method.

func (*MockExecWrapper) EXPECT

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

func (*MockExecWrapper) LookPath

func (m *MockExecWrapper) LookPath(file string) (string, error)

LookPath mocks base method.

type MockExecWrapperMockRecorder

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

MockExecWrapperMockRecorder is the mock recorder for MockExecWrapper.

func (*MockExecWrapperMockRecorder) CommandContext

func (mr *MockExecWrapperMockRecorder) CommandContext(ctx, name any, arg ...any) *gomock.Call

CommandContext indicates an expected call of CommandContext.

func (*MockExecWrapperMockRecorder) LookPath

func (mr *MockExecWrapperMockRecorder) LookPath(file any) *gomock.Call

LookPath indicates an expected call of LookPath.

type RealExecCmd

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

RealExecCmd wraps exec.Cmd to implement ExecCmd interface

func (*RealExecCmd) CombinedOutput

func (r *RealExecCmd) CombinedOutput() ([]byte, error)

CombinedOutput runs the command and returns its combined standard output and standard error

type RealExecWrapper

type RealExecWrapper struct{}

RealExecWrapper implements ExecWrapper using the real exec package

func (*RealExecWrapper) CommandContext

func (r *RealExecWrapper) CommandContext(ctx context.Context, name string, arg ...string) ExecCmd

CommandContext returns the Cmd struct to execute the named program with the given arguments

func (*RealExecWrapper) LookPath

func (r *RealExecWrapper) LookPath(file string) (string, error)

LookPath searches for an executable named file in the directories named by the PATH environment variable

Jump to

Keyboard shortcuts

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