Documentation
¶
Index ¶
- Constants
- type Manager
- type ManagerMock
- func (_m *ManagerMock) EXPECT() *ManagerMock_Expecter
- func (_m *ManagerMock) Exists(pid int) (bool, error)
- func (_m *ManagerMock) Find(pid int) (*os.Process, error)
- func (_m *ManagerMock) Prioritize() error
- func (_m *ManagerMock) ProcessID() int
- func (_m *ManagerMock) SetAffinity(_a0 []int) error
- func (_m *ManagerMock) Signal(_a0 *os.Process, signal os.Signal) error
- func (_m *ManagerMock) ThreadID() int
- type ManagerMock_Exists_Call
- type ManagerMock_Expecter
- func (_e *ManagerMock_Expecter) Exists(pid interface{}) *ManagerMock_Exists_Call
- func (_e *ManagerMock_Expecter) Find(pid interface{}) *ManagerMock_Find_Call
- func (_e *ManagerMock_Expecter) Prioritize() *ManagerMock_Prioritize_Call
- func (_e *ManagerMock_Expecter) ProcessID() *ManagerMock_ProcessID_Call
- func (_e *ManagerMock_Expecter) SetAffinity(_a0 interface{}) *ManagerMock_SetAffinity_Call
- func (_e *ManagerMock_Expecter) Signal(_a0 interface{}, signal interface{}) *ManagerMock_Signal_Call
- func (_e *ManagerMock_Expecter) ThreadID() *ManagerMock_ThreadID_Call
- type ManagerMock_Find_Call
- type ManagerMock_Prioritize_Call
- type ManagerMock_ProcessID_Call
- type ManagerMock_SetAffinity_Call
- type ManagerMock_Signal_Call
- type ManagerMock_ThreadID_Call
- type Runtime
- type RuntimeMock
- type RuntimeMock_Expecter
- type RuntimeMock_GOMAXPROCS_Call
- type RuntimeMock_LockOSThread_Call
- type RuntimeMock_UnlockOSThread_Call
Constants ¶
const (
NotFoundProcessPID = -1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { Prioritize() error ThreadID() int ProcessID() int Exists(pid int) (bool, error) Find(pid int) (*os.Process, error) Signal(process *os.Process, signal os.Signal) error SetAffinity([]int) error }
Manager manages a process
type ManagerMock ¶
ManagerMock is an autogenerated mock type for the Manager type
func NewManagerMock ¶
func NewManagerMock(t interface { mock.TestingT Cleanup(func()) }) *ManagerMock
NewManagerMock creates a new instance of ManagerMock. 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 (*ManagerMock) EXPECT ¶
func (_m *ManagerMock) EXPECT() *ManagerMock_Expecter
func (*ManagerMock) Exists ¶
func (_m *ManagerMock) Exists(pid int) (bool, error)
Exists provides a mock function with given fields: pid
func (*ManagerMock) Find ¶
func (_m *ManagerMock) Find(pid int) (*os.Process, error)
Find provides a mock function with given fields: pid
func (*ManagerMock) Prioritize ¶
func (_m *ManagerMock) Prioritize() error
Prioritize provides a mock function with no fields
func (*ManagerMock) ProcessID ¶
func (_m *ManagerMock) ProcessID() int
ProcessID provides a mock function with no fields
func (*ManagerMock) SetAffinity ¶
func (_m *ManagerMock) SetAffinity(_a0 []int) error
SetAffinity provides a mock function with given fields: _a0
func (*ManagerMock) ThreadID ¶
func (_m *ManagerMock) ThreadID() int
ThreadID provides a mock function with no fields
type ManagerMock_Exists_Call ¶
ManagerMock_Exists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exists'
func (*ManagerMock_Exists_Call) Return ¶
func (_c *ManagerMock_Exists_Call) Return(_a0 bool, _a1 error) *ManagerMock_Exists_Call
func (*ManagerMock_Exists_Call) Run ¶
func (_c *ManagerMock_Exists_Call) Run(run func(pid int)) *ManagerMock_Exists_Call
func (*ManagerMock_Exists_Call) RunAndReturn ¶
func (_c *ManagerMock_Exists_Call) RunAndReturn(run func(int) (bool, error)) *ManagerMock_Exists_Call
type ManagerMock_Expecter ¶
type ManagerMock_Expecter struct {
// contains filtered or unexported fields
}
func (*ManagerMock_Expecter) Exists ¶
func (_e *ManagerMock_Expecter) Exists(pid interface{}) *ManagerMock_Exists_Call
Exists is a helper method to define mock.On call
- pid int
func (*ManagerMock_Expecter) Find ¶
func (_e *ManagerMock_Expecter) Find(pid interface{}) *ManagerMock_Find_Call
Find is a helper method to define mock.On call
- pid int
func (*ManagerMock_Expecter) Prioritize ¶
func (_e *ManagerMock_Expecter) Prioritize() *ManagerMock_Prioritize_Call
Prioritize is a helper method to define mock.On call
func (*ManagerMock_Expecter) ProcessID ¶
func (_e *ManagerMock_Expecter) ProcessID() *ManagerMock_ProcessID_Call
ProcessID is a helper method to define mock.On call
func (*ManagerMock_Expecter) SetAffinity ¶
func (_e *ManagerMock_Expecter) SetAffinity(_a0 interface{}) *ManagerMock_SetAffinity_Call
SetAffinity is a helper method to define mock.On call
- _a0 []int
func (*ManagerMock_Expecter) Signal ¶
func (_e *ManagerMock_Expecter) Signal(_a0 interface{}, signal interface{}) *ManagerMock_Signal_Call
Signal is a helper method to define mock.On call
- _a0 *os.Process
- signal os.Signal
func (*ManagerMock_Expecter) ThreadID ¶
func (_e *ManagerMock_Expecter) ThreadID() *ManagerMock_ThreadID_Call
ThreadID is a helper method to define mock.On call
type ManagerMock_Find_Call ¶
ManagerMock_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find'
func (*ManagerMock_Find_Call) Return ¶
func (_c *ManagerMock_Find_Call) Return(_a0 *os.Process, _a1 error) *ManagerMock_Find_Call
func (*ManagerMock_Find_Call) Run ¶
func (_c *ManagerMock_Find_Call) Run(run func(pid int)) *ManagerMock_Find_Call
func (*ManagerMock_Find_Call) RunAndReturn ¶
func (_c *ManagerMock_Find_Call) RunAndReturn(run func(int) (*os.Process, error)) *ManagerMock_Find_Call
type ManagerMock_Prioritize_Call ¶
ManagerMock_Prioritize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prioritize'
func (*ManagerMock_Prioritize_Call) Return ¶
func (_c *ManagerMock_Prioritize_Call) Return(_a0 error) *ManagerMock_Prioritize_Call
func (*ManagerMock_Prioritize_Call) Run ¶
func (_c *ManagerMock_Prioritize_Call) Run(run func()) *ManagerMock_Prioritize_Call
func (*ManagerMock_Prioritize_Call) RunAndReturn ¶
func (_c *ManagerMock_Prioritize_Call) RunAndReturn(run func() error) *ManagerMock_Prioritize_Call
type ManagerMock_ProcessID_Call ¶
ManagerMock_ProcessID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessID'
func (*ManagerMock_ProcessID_Call) Return ¶
func (_c *ManagerMock_ProcessID_Call) Return(_a0 int) *ManagerMock_ProcessID_Call
func (*ManagerMock_ProcessID_Call) Run ¶
func (_c *ManagerMock_ProcessID_Call) Run(run func()) *ManagerMock_ProcessID_Call
func (*ManagerMock_ProcessID_Call) RunAndReturn ¶
func (_c *ManagerMock_ProcessID_Call) RunAndReturn(run func() int) *ManagerMock_ProcessID_Call
type ManagerMock_SetAffinity_Call ¶
ManagerMock_SetAffinity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAffinity'
func (*ManagerMock_SetAffinity_Call) Return ¶
func (_c *ManagerMock_SetAffinity_Call) Return(_a0 error) *ManagerMock_SetAffinity_Call
func (*ManagerMock_SetAffinity_Call) Run ¶
func (_c *ManagerMock_SetAffinity_Call) Run(run func(_a0 []int)) *ManagerMock_SetAffinity_Call
func (*ManagerMock_SetAffinity_Call) RunAndReturn ¶
func (_c *ManagerMock_SetAffinity_Call) RunAndReturn(run func([]int) error) *ManagerMock_SetAffinity_Call
type ManagerMock_Signal_Call ¶
ManagerMock_Signal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signal'
func (*ManagerMock_Signal_Call) Return ¶
func (_c *ManagerMock_Signal_Call) Return(_a0 error) *ManagerMock_Signal_Call
func (*ManagerMock_Signal_Call) Run ¶
func (_c *ManagerMock_Signal_Call) Run(run func(_a0 *os.Process, signal os.Signal)) *ManagerMock_Signal_Call
func (*ManagerMock_Signal_Call) RunAndReturn ¶
func (_c *ManagerMock_Signal_Call) RunAndReturn(run func(*os.Process, os.Signal) error) *ManagerMock_Signal_Call
type ManagerMock_ThreadID_Call ¶
ManagerMock_ThreadID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ThreadID'
func (*ManagerMock_ThreadID_Call) Return ¶
func (_c *ManagerMock_ThreadID_Call) Return(_a0 int) *ManagerMock_ThreadID_Call
func (*ManagerMock_ThreadID_Call) Run ¶
func (_c *ManagerMock_ThreadID_Call) Run(run func()) *ManagerMock_ThreadID_Call
func (*ManagerMock_ThreadID_Call) RunAndReturn ¶
func (_c *ManagerMock_ThreadID_Call) RunAndReturn(run func() int) *ManagerMock_ThreadID_Call
type Runtime ¶
type Runtime interface { // GOMAXPROCS sets the maximum number of CPUs that can be executing // simultaneously and returns the previous setting. It defaults to // the value of runtime.NumCPU. If n < 1, it does not change the current setting. // This call will go away when the scheduler improves. GOMAXPROCS(int) int GOMAXPROCS(int) int // LockOSThread wires the calling goroutine to its current operating system thread. // The calling goroutine will always execute in that thread, // and no other goroutine will execute in it, // until the calling goroutine has made as many calls to // UnlockOSThread as to LockOSThread. // If the calling goroutine exits without unlocking the thread, // the thread will be terminated. // // All init functions are run on the startup thread. Calling LockOSThread // from an init function will cause the main function to be invoked on // that thread. // // A goroutine should call LockOSThread before calling OS services or // non-Go library functions that depend on per-thread state. LockOSThread() // UnlockOSThread undoes an earlier call to LockOSThread. // If this drops the number of active LockOSThread calls on the // calling goroutine to zero, it unwires the calling goroutine from // its fixed operating system thread. // If there are no active LockOSThread calls, this is a no-op. // // Before calling UnlockOSThread, the caller must ensure that the OS // thread is suitable for running other goroutines. If the caller made // any permanent changes to the state of the thread that would affect // other goroutines, it should not call this function and thus leave // the goroutine locked to the OS thread until the goroutine (and // hence the thread) exits. UnlockOSThread() }
func NewRuntime ¶
type RuntimeMock ¶
RuntimeMock is an autogenerated mock type for the Runtime type
func NewRuntimeMock ¶
func NewRuntimeMock(t interface { mock.TestingT Cleanup(func()) }) *RuntimeMock
NewRuntimeMock creates a new instance of RuntimeMock. 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 (*RuntimeMock) EXPECT ¶
func (_m *RuntimeMock) EXPECT() *RuntimeMock_Expecter
func (*RuntimeMock) GOMAXPROCS ¶
func (_m *RuntimeMock) GOMAXPROCS(_a0 int) int
GOMAXPROCS provides a mock function with given fields: _a0
func (*RuntimeMock) LockOSThread ¶
func (_m *RuntimeMock) LockOSThread()
LockOSThread provides a mock function with no fields
func (*RuntimeMock) UnlockOSThread ¶
func (_m *RuntimeMock) UnlockOSThread()
UnlockOSThread provides a mock function with no fields
type RuntimeMock_Expecter ¶
type RuntimeMock_Expecter struct {
// contains filtered or unexported fields
}
func (*RuntimeMock_Expecter) GOMAXPROCS ¶
func (_e *RuntimeMock_Expecter) GOMAXPROCS(_a0 interface{}) *RuntimeMock_GOMAXPROCS_Call
GOMAXPROCS is a helper method to define mock.On call
- _a0 int
func (*RuntimeMock_Expecter) LockOSThread ¶
func (_e *RuntimeMock_Expecter) LockOSThread() *RuntimeMock_LockOSThread_Call
LockOSThread is a helper method to define mock.On call
func (*RuntimeMock_Expecter) UnlockOSThread ¶
func (_e *RuntimeMock_Expecter) UnlockOSThread() *RuntimeMock_UnlockOSThread_Call
UnlockOSThread is a helper method to define mock.On call
type RuntimeMock_GOMAXPROCS_Call ¶
RuntimeMock_GOMAXPROCS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GOMAXPROCS'
func (*RuntimeMock_GOMAXPROCS_Call) Return ¶
func (_c *RuntimeMock_GOMAXPROCS_Call) Return(_a0 int) *RuntimeMock_GOMAXPROCS_Call
func (*RuntimeMock_GOMAXPROCS_Call) Run ¶
func (_c *RuntimeMock_GOMAXPROCS_Call) Run(run func(_a0 int)) *RuntimeMock_GOMAXPROCS_Call
func (*RuntimeMock_GOMAXPROCS_Call) RunAndReturn ¶
func (_c *RuntimeMock_GOMAXPROCS_Call) RunAndReturn(run func(int) int) *RuntimeMock_GOMAXPROCS_Call
type RuntimeMock_LockOSThread_Call ¶
RuntimeMock_LockOSThread_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LockOSThread'
func (*RuntimeMock_LockOSThread_Call) Return ¶
func (_c *RuntimeMock_LockOSThread_Call) Return() *RuntimeMock_LockOSThread_Call
func (*RuntimeMock_LockOSThread_Call) Run ¶
func (_c *RuntimeMock_LockOSThread_Call) Run(run func()) *RuntimeMock_LockOSThread_Call
func (*RuntimeMock_LockOSThread_Call) RunAndReturn ¶
func (_c *RuntimeMock_LockOSThread_Call) RunAndReturn(run func()) *RuntimeMock_LockOSThread_Call
type RuntimeMock_UnlockOSThread_Call ¶
RuntimeMock_UnlockOSThread_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnlockOSThread'
func (*RuntimeMock_UnlockOSThread_Call) Return ¶
func (_c *RuntimeMock_UnlockOSThread_Call) Return() *RuntimeMock_UnlockOSThread_Call
func (*RuntimeMock_UnlockOSThread_Call) Run ¶
func (_c *RuntimeMock_UnlockOSThread_Call) Run(run func()) *RuntimeMock_UnlockOSThread_Call
func (*RuntimeMock_UnlockOSThread_Call) RunAndReturn ¶
func (_c *RuntimeMock_UnlockOSThread_Call) RunAndReturn(run func()) *RuntimeMock_UnlockOSThread_Call