Documentation ¶
Overview ¶
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.
Index ¶
- Constants
- type BackgroundCmd
- type BackgroundCmdMock
- type BackgroundCmdMock_DryRun_Call
- type BackgroundCmdMock_Expecter
- func (_e *BackgroundCmdMock_Expecter) DryRun() *BackgroundCmdMock_DryRun_Call
- func (_e *BackgroundCmdMock_Expecter) KeepAlive() *BackgroundCmdMock_KeepAlive_Call
- func (_e *BackgroundCmdMock_Expecter) Start() *BackgroundCmdMock_Start_Call
- func (_e *BackgroundCmdMock_Expecter) Stop() *BackgroundCmdMock_Stop_Call
- type BackgroundCmdMock_KeepAlive_Call
- type BackgroundCmdMock_Start_Call
- type BackgroundCmdMock_Stop_Call
- type Cmd
- type CmdMock
- type CmdMock_DryRun_Call
- type CmdMock_ExitCode_Call
- type CmdMock_Expecter
- func (_e *CmdMock_Expecter) DryRun() *CmdMock_DryRun_Call
- func (_e *CmdMock_Expecter) ExitCode() *CmdMock_ExitCode_Call
- func (_e *CmdMock_Expecter) PID() *CmdMock_PID_Call
- func (_e *CmdMock_Expecter) Start() *CmdMock_Start_Call
- func (_e *CmdMock_Expecter) String() *CmdMock_String_Call
- func (_e *CmdMock_Expecter) Wait() *CmdMock_Wait_Call
- type CmdMock_PID_Call
- type CmdMock_Start_Call
- type CmdMock_String_Call
- type CmdMock_Wait_Call
- type Factory
- type FactoryMock
- type FactoryMock_Expecter
- type FactoryMock_NewCmd_Call
- func (_c *FactoryMock_NewCmd_Call) Return(_a0 Cmd) *FactoryMock_NewCmd_Call
- func (_c *FactoryMock_NewCmd_Call) Run(run func(ctx context.Context, name string, args []string)) *FactoryMock_NewCmd_Call
- func (_c *FactoryMock_NewCmd_Call) RunAndReturn(run func(context.Context, string, []string) Cmd) *FactoryMock_NewCmd_Call
Constants ¶
const (
NotFoundProcessExitCode = -1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackgroundCmd ¶
BackgroundCmd wraps a ContextCmd methods to provide monitorability of a ContextCmd that is launched in background
func NewBackgroundCmd ¶
func NewBackgroundCmd(cmd Cmd, log *zap.SugaredLogger, processManager process.Manager) BackgroundCmd
type BackgroundCmdMock ¶
BackgroundCmdMock is an autogenerated mock type for the BackgroundCmd type
func NewBackgroundCmdMock ¶
func NewBackgroundCmdMock(t interface { mock.TestingT Cleanup(func()) }) *BackgroundCmdMock
NewBackgroundCmdMock creates a new instance of BackgroundCmdMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*BackgroundCmdMock) DryRun ¶
func (_m *BackgroundCmdMock) DryRun() bool
DryRun provides a mock function with given fields:
func (*BackgroundCmdMock) EXPECT ¶
func (_m *BackgroundCmdMock) EXPECT() *BackgroundCmdMock_Expecter
func (*BackgroundCmdMock) KeepAlive ¶
func (_m *BackgroundCmdMock) KeepAlive()
KeepAlive provides a mock function with given fields:
func (*BackgroundCmdMock) Start ¶
func (_m *BackgroundCmdMock) Start() error
Start provides a mock function with given fields:
func (*BackgroundCmdMock) Stop ¶
func (_m *BackgroundCmdMock) Stop() error
Stop provides a mock function with given fields:
type BackgroundCmdMock_DryRun_Call ¶
BackgroundCmdMock_DryRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DryRun'
func (*BackgroundCmdMock_DryRun_Call) Return ¶
func (_c *BackgroundCmdMock_DryRun_Call) Return(_a0 bool) *BackgroundCmdMock_DryRun_Call
func (*BackgroundCmdMock_DryRun_Call) Run ¶
func (_c *BackgroundCmdMock_DryRun_Call) Run(run func()) *BackgroundCmdMock_DryRun_Call
func (*BackgroundCmdMock_DryRun_Call) RunAndReturn ¶
func (_c *BackgroundCmdMock_DryRun_Call) RunAndReturn(run func() bool) *BackgroundCmdMock_DryRun_Call
type BackgroundCmdMock_Expecter ¶
type BackgroundCmdMock_Expecter struct {
// contains filtered or unexported fields
}
func (*BackgroundCmdMock_Expecter) DryRun ¶
func (_e *BackgroundCmdMock_Expecter) DryRun() *BackgroundCmdMock_DryRun_Call
DryRun is a helper method to define mock.On call
func (*BackgroundCmdMock_Expecter) KeepAlive ¶
func (_e *BackgroundCmdMock_Expecter) KeepAlive() *BackgroundCmdMock_KeepAlive_Call
KeepAlive is a helper method to define mock.On call
func (*BackgroundCmdMock_Expecter) Start ¶
func (_e *BackgroundCmdMock_Expecter) Start() *BackgroundCmdMock_Start_Call
Start is a helper method to define mock.On call
func (*BackgroundCmdMock_Expecter) Stop ¶
func (_e *BackgroundCmdMock_Expecter) Stop() *BackgroundCmdMock_Stop_Call
Stop is a helper method to define mock.On call
type BackgroundCmdMock_KeepAlive_Call ¶
BackgroundCmdMock_KeepAlive_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'KeepAlive'
func (*BackgroundCmdMock_KeepAlive_Call) Return ¶
func (_c *BackgroundCmdMock_KeepAlive_Call) Return() *BackgroundCmdMock_KeepAlive_Call
func (*BackgroundCmdMock_KeepAlive_Call) Run ¶
func (_c *BackgroundCmdMock_KeepAlive_Call) Run(run func()) *BackgroundCmdMock_KeepAlive_Call
func (*BackgroundCmdMock_KeepAlive_Call) RunAndReturn ¶
func (_c *BackgroundCmdMock_KeepAlive_Call) RunAndReturn(run func()) *BackgroundCmdMock_KeepAlive_Call
type BackgroundCmdMock_Start_Call ¶
BackgroundCmdMock_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
func (*BackgroundCmdMock_Start_Call) Return ¶
func (_c *BackgroundCmdMock_Start_Call) Return(_a0 error) *BackgroundCmdMock_Start_Call
func (*BackgroundCmdMock_Start_Call) Run ¶
func (_c *BackgroundCmdMock_Start_Call) Run(run func()) *BackgroundCmdMock_Start_Call
func (*BackgroundCmdMock_Start_Call) RunAndReturn ¶
func (_c *BackgroundCmdMock_Start_Call) RunAndReturn(run func() error) *BackgroundCmdMock_Start_Call
type BackgroundCmdMock_Stop_Call ¶
BackgroundCmdMock_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
func (*BackgroundCmdMock_Stop_Call) Return ¶
func (_c *BackgroundCmdMock_Stop_Call) Return(_a0 error) *BackgroundCmdMock_Stop_Call
func (*BackgroundCmdMock_Stop_Call) Run ¶
func (_c *BackgroundCmdMock_Stop_Call) Run(run func()) *BackgroundCmdMock_Stop_Call
func (*BackgroundCmdMock_Stop_Call) RunAndReturn ¶
func (_c *BackgroundCmdMock_Stop_Call) RunAndReturn(run func() error) *BackgroundCmdMock_Stop_Call
type Cmd ¶
type Cmd interface { Start() error String() string Wait() error PID() int ExitCode() int DryRun() bool }
Cmd aims to be a convenient wrapper around os/exec.CommandContext to ease testing and move some process methods up (PID/ExitCode)
type CmdMock ¶
CmdMock is an autogenerated mock type for the Cmd type
func NewCmdMock ¶
NewCmdMock creates a new instance of CmdMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*CmdMock) EXPECT ¶
func (_m *CmdMock) EXPECT() *CmdMock_Expecter
type CmdMock_DryRun_Call ¶
CmdMock_DryRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DryRun'
func (*CmdMock_DryRun_Call) Return ¶
func (_c *CmdMock_DryRun_Call) Return(_a0 bool) *CmdMock_DryRun_Call
func (*CmdMock_DryRun_Call) Run ¶
func (_c *CmdMock_DryRun_Call) Run(run func()) *CmdMock_DryRun_Call
func (*CmdMock_DryRun_Call) RunAndReturn ¶
func (_c *CmdMock_DryRun_Call) RunAndReturn(run func() bool) *CmdMock_DryRun_Call
type CmdMock_ExitCode_Call ¶
CmdMock_ExitCode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExitCode'
func (*CmdMock_ExitCode_Call) Return ¶
func (_c *CmdMock_ExitCode_Call) Return(_a0 int) *CmdMock_ExitCode_Call
func (*CmdMock_ExitCode_Call) Run ¶
func (_c *CmdMock_ExitCode_Call) Run(run func()) *CmdMock_ExitCode_Call
func (*CmdMock_ExitCode_Call) RunAndReturn ¶
func (_c *CmdMock_ExitCode_Call) RunAndReturn(run func() int) *CmdMock_ExitCode_Call
type CmdMock_Expecter ¶
type CmdMock_Expecter struct {
// contains filtered or unexported fields
}
func (*CmdMock_Expecter) DryRun ¶
func (_e *CmdMock_Expecter) DryRun() *CmdMock_DryRun_Call
DryRun is a helper method to define mock.On call
func (*CmdMock_Expecter) ExitCode ¶
func (_e *CmdMock_Expecter) ExitCode() *CmdMock_ExitCode_Call
ExitCode is a helper method to define mock.On call
func (*CmdMock_Expecter) PID ¶
func (_e *CmdMock_Expecter) PID() *CmdMock_PID_Call
PID is a helper method to define mock.On call
func (*CmdMock_Expecter) Start ¶
func (_e *CmdMock_Expecter) Start() *CmdMock_Start_Call
Start is a helper method to define mock.On call
func (*CmdMock_Expecter) String ¶
func (_e *CmdMock_Expecter) String() *CmdMock_String_Call
String is a helper method to define mock.On call
func (*CmdMock_Expecter) Wait ¶
func (_e *CmdMock_Expecter) Wait() *CmdMock_Wait_Call
Wait is a helper method to define mock.On call
type CmdMock_PID_Call ¶
CmdMock_PID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PID'
func (*CmdMock_PID_Call) Return ¶
func (_c *CmdMock_PID_Call) Return(_a0 int) *CmdMock_PID_Call
func (*CmdMock_PID_Call) Run ¶
func (_c *CmdMock_PID_Call) Run(run func()) *CmdMock_PID_Call
func (*CmdMock_PID_Call) RunAndReturn ¶
func (_c *CmdMock_PID_Call) RunAndReturn(run func() int) *CmdMock_PID_Call
type CmdMock_Start_Call ¶
CmdMock_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
func (*CmdMock_Start_Call) Return ¶
func (_c *CmdMock_Start_Call) Return(_a0 error) *CmdMock_Start_Call
func (*CmdMock_Start_Call) Run ¶
func (_c *CmdMock_Start_Call) Run(run func()) *CmdMock_Start_Call
func (*CmdMock_Start_Call) RunAndReturn ¶
func (_c *CmdMock_Start_Call) RunAndReturn(run func() error) *CmdMock_Start_Call
type CmdMock_String_Call ¶
CmdMock_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String'
func (*CmdMock_String_Call) Return ¶
func (_c *CmdMock_String_Call) Return(_a0 string) *CmdMock_String_Call
func (*CmdMock_String_Call) Run ¶
func (_c *CmdMock_String_Call) Run(run func()) *CmdMock_String_Call
func (*CmdMock_String_Call) RunAndReturn ¶
func (_c *CmdMock_String_Call) RunAndReturn(run func() string) *CmdMock_String_Call
type CmdMock_Wait_Call ¶
CmdMock_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait'
func (*CmdMock_Wait_Call) Return ¶
func (_c *CmdMock_Wait_Call) Return(_a0 error) *CmdMock_Wait_Call
func (*CmdMock_Wait_Call) Run ¶
func (_c *CmdMock_Wait_Call) Run(run func()) *CmdMock_Wait_Call
func (*CmdMock_Wait_Call) RunAndReturn ¶
func (_c *CmdMock_Wait_Call) RunAndReturn(run func() error) *CmdMock_Wait_Call
type Factory ¶
Factory defines how we want to create a command (with context and with relevant fields set)
func NewFactory ¶
type FactoryMock ¶
FactoryMock is an autogenerated mock type for the Factory type
func NewFactoryMock ¶
func NewFactoryMock(t interface { mock.TestingT Cleanup(func()) }) *FactoryMock
NewFactoryMock creates a new instance of FactoryMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*FactoryMock) EXPECT ¶
func (_m *FactoryMock) EXPECT() *FactoryMock_Expecter
type FactoryMock_Expecter ¶
type FactoryMock_Expecter struct {
// contains filtered or unexported fields
}
func (*FactoryMock_Expecter) NewCmd ¶
func (_e *FactoryMock_Expecter) NewCmd(ctx interface{}, name interface{}, args interface{}) *FactoryMock_NewCmd_Call
NewCmd is a helper method to define mock.On call
- ctx context.Context
- name string
- args []string
type FactoryMock_NewCmd_Call ¶
FactoryMock_NewCmd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewCmd'
func (*FactoryMock_NewCmd_Call) Return ¶
func (_c *FactoryMock_NewCmd_Call) Return(_a0 Cmd) *FactoryMock_NewCmd_Call
func (*FactoryMock_NewCmd_Call) Run ¶
func (_c *FactoryMock_NewCmd_Call) Run(run func(ctx context.Context, name string, args []string)) *FactoryMock_NewCmd_Call
func (*FactoryMock_NewCmd_Call) RunAndReturn ¶
func (_c *FactoryMock_NewCmd_Call) RunAndReturn(run func(context.Context, string, []string) Cmd) *FactoryMock_NewCmd_Call