Documentation
¶
Overview ¶
Package executer is a generated GoMock package.
Index ¶
- func NewCommonExecuter(options ...ExecuterOption) *commonExecuter
- type Executer
- type ExecuterOption
- type MockExecuter
- func (m *MockExecuter) CommandContext(ctx context.Context, command string, args ...string) *exec.Cmd
- func (m *MockExecuter) EXPECT() *MockExecuterMockRecorder
- func (m *MockExecuter) Execute(command string, args ...string) (string, string, int)
- func (m *MockExecuter) ExecuteWithContext(ctx context.Context, command string, args ...string) (string, string, int)
- func (m *MockExecuter) ExecuteWithContextFromDir(ctx context.Context, workingDir, command string, args []string, env ...string) (string, string, int)
- type MockExecuterMockRecorder
- func (mr *MockExecuterMockRecorder) CommandContext(ctx, command any, args ...any) *gomock.Call
- func (mr *MockExecuterMockRecorder) Execute(command any, args ...any) *gomock.Call
- func (mr *MockExecuterMockRecorder) ExecuteWithContext(ctx, command any, args ...any) *gomock.Call
- func (mr *MockExecuterMockRecorder) ExecuteWithContextFromDir(ctx, workingDir, command, args any, env ...any) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommonExecuter ¶
func NewCommonExecuter(options ...ExecuterOption) *commonExecuter
Types ¶
type Executer ¶
type Executer interface {
CommandContext(ctx context.Context, command string, args ...string) *exec.Cmd
Execute(command string, args ...string) (stdout string, stderr string, exitCode int)
ExecuteWithContext(ctx context.Context, command string, args ...string) (stdout string, stderr string, exitCode int)
ExecuteWithContextFromDir(ctx context.Context, workingDir string, command string, args []string, env ...string) (stdout string, stderr string, exitCode int)
}
type ExecuterOption ¶
type ExecuterOption func(e *commonExecuter)
func LookupUserOptions ¶
func LookupUserOptions(username v1beta1.Username) ([]ExecuterOption, error)
LookupUserOptions generates a set of options to NewCommonExecuter used to execute commands as a different user.
func WithHomeDir ¶
func WithHomeDir(homeDir string) ExecuterOption
func WithUIDAndGID ¶
func WithUIDAndGID(uid uint32, gid uint32) ExecuterOption
type MockExecuter ¶
type MockExecuter struct {
// contains filtered or unexported fields
}
MockExecuter is a mock of Executer interface.
func NewMockExecuter ¶
func NewMockExecuter(ctrl *gomock.Controller) *MockExecuter
NewMockExecuter creates a new mock instance.
func (*MockExecuter) CommandContext ¶ added in v0.2.0
func (m *MockExecuter) CommandContext(ctx context.Context, command string, args ...string) *exec.Cmd
CommandContext mocks base method.
func (*MockExecuter) EXPECT ¶
func (m *MockExecuter) EXPECT() *MockExecuterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockExecuter) ExecuteWithContext ¶
func (m *MockExecuter) ExecuteWithContext(ctx context.Context, command string, args ...string) (string, string, int)
ExecuteWithContext mocks base method.
type MockExecuterMockRecorder ¶
type MockExecuterMockRecorder struct {
// contains filtered or unexported fields
}
MockExecuterMockRecorder is the mock recorder for MockExecuter.
func (*MockExecuterMockRecorder) CommandContext ¶ added in v0.2.0
func (mr *MockExecuterMockRecorder) CommandContext(ctx, command any, args ...any) *gomock.Call
CommandContext indicates an expected call of CommandContext.
func (*MockExecuterMockRecorder) Execute ¶
func (mr *MockExecuterMockRecorder) Execute(command any, args ...any) *gomock.Call
Execute indicates an expected call of Execute.
func (*MockExecuterMockRecorder) ExecuteWithContext ¶
func (mr *MockExecuterMockRecorder) ExecuteWithContext(ctx, command any, args ...any) *gomock.Call
ExecuteWithContext indicates an expected call of ExecuteWithContext.
func (*MockExecuterMockRecorder) ExecuteWithContextFromDir ¶
func (mr *MockExecuterMockRecorder) ExecuteWithContextFromDir(ctx, workingDir, command, args any, env ...any) *gomock.Call
ExecuteWithContextFromDir indicates an expected call of ExecuteWithContextFromDir.