Documentation
¶
Overview ¶
Package mocks provides mock implementations for container interfaces used in testing.
Index ¶
- type MockSorter
- type MockSorter_Expecter
- type MockSorter_Sort_Call
- type SimpleContainer
- func (c *SimpleContainer) ContainerInfo() *dockerContainer.InspectResponse
- func (c *SimpleContainer) Enabled() (bool, bool)
- func (c *SimpleContainer) GetContainerChain() (string, bool)
- func (c *SimpleContainer) GetCreateConfig() *dockerContainer.Config
- func (c *SimpleContainer) GetCreateHostConfig() *dockerContainer.HostConfig
- func (c *SimpleContainer) GetLifecycleGID() (int, bool)
- func (c *SimpleContainer) GetLifecyclePostCheckCommand() string
- func (c *SimpleContainer) GetLifecyclePostUpdateCommand() string
- func (c *SimpleContainer) GetLifecyclePreCheckCommand() string
- func (c *SimpleContainer) GetLifecyclePreUpdateCommand() string
- func (c *SimpleContainer) GetLifecycleUID() (int, bool)
- func (c *SimpleContainer) HasImageInfo() bool
- func (c *SimpleContainer) ID() types.ContainerID
- func (c *SimpleContainer) ImageID() types.ImageID
- func (c *SimpleContainer) ImageInfo() *dockerImage.InspectResponse
- func (c *SimpleContainer) ImageName() string
- func (c *SimpleContainer) IsLinkedToRestarting() bool
- func (c *SimpleContainer) IsMonitorOnly(_ types.UpdateParams) bool
- func (c *SimpleContainer) IsNoPull(_ types.UpdateParams) bool
- func (c *SimpleContainer) IsRestarting() bool
- func (c *SimpleContainer) IsRunning() bool
- func (c *SimpleContainer) IsStale() bool
- func (c *SimpleContainer) IsWatchtower() bool
- func (c *SimpleContainer) Links() []string
- func (c *SimpleContainer) Name() string
- func (c *SimpleContainer) PostUpdateTimeout() int
- func (c *SimpleContainer) PreUpdateTimeout() int
- func (c *SimpleContainer) Scope() (string, bool)
- func (c *SimpleContainer) SetLinkedToRestarting(_ bool)
- func (c *SimpleContainer) SetStale(_ bool)
- func (c *SimpleContainer) StopSignal() string
- func (c *SimpleContainer) StopTimeout() *int
- func (c *SimpleContainer) ToRestart() bool
- func (c *SimpleContainer) VerifyConfiguration() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockSorter ¶
MockSorter is an autogenerated mock type for the Sorter type
func NewMockSorter ¶
func NewMockSorter(t interface {
mock.TestingT
Cleanup(func())
}) *MockSorter
NewMockSorter creates a new instance of MockSorter. 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 (*MockSorter) EXPECT ¶
func (_m *MockSorter) EXPECT() *MockSorter_Expecter
type MockSorter_Expecter ¶
type MockSorter_Expecter struct {
// contains filtered or unexported fields
}
func (*MockSorter_Expecter) Sort ¶
func (_e *MockSorter_Expecter) Sort(containers interface{}) *MockSorter_Sort_Call
Sort is a helper method to define mock.On call
- containers []types.Container
type MockSorter_Sort_Call ¶
MockSorter_Sort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sort'
func (*MockSorter_Sort_Call) Return ¶
func (_c *MockSorter_Sort_Call) Return(err error) *MockSorter_Sort_Call
func (*MockSorter_Sort_Call) Run ¶
func (_c *MockSorter_Sort_Call) Run(run func(containers []types.Container)) *MockSorter_Sort_Call
func (*MockSorter_Sort_Call) RunAndReturn ¶
func (_c *MockSorter_Sort_Call) RunAndReturn(run func(containers []types.Container) error) *MockSorter_Sort_Call
type SimpleContainer ¶
type SimpleContainer struct {
ContainerName string
ContainerID types.ContainerID
ContainerLinks []string
ContainerInfoField *dockerContainer.InspectResponse
}
SimpleContainer implements a minimal Container interface for benchmarking.
func (*SimpleContainer) ContainerInfo ¶
func (c *SimpleContainer) ContainerInfo() *dockerContainer.InspectResponse
func (*SimpleContainer) Enabled ¶
func (c *SimpleContainer) Enabled() (bool, bool)
func (*SimpleContainer) GetContainerChain ¶
func (c *SimpleContainer) GetContainerChain() (string, bool)
func (*SimpleContainer) GetCreateConfig ¶
func (c *SimpleContainer) GetCreateConfig() *dockerContainer.Config
func (*SimpleContainer) GetCreateHostConfig ¶
func (c *SimpleContainer) GetCreateHostConfig() *dockerContainer.HostConfig
func (*SimpleContainer) GetLifecycleGID ¶
func (c *SimpleContainer) GetLifecycleGID() (int, bool)
func (*SimpleContainer) GetLifecyclePostCheckCommand ¶
func (c *SimpleContainer) GetLifecyclePostCheckCommand() string
func (*SimpleContainer) GetLifecyclePostUpdateCommand ¶
func (c *SimpleContainer) GetLifecyclePostUpdateCommand() string
func (*SimpleContainer) GetLifecyclePreCheckCommand ¶
func (c *SimpleContainer) GetLifecyclePreCheckCommand() string
func (*SimpleContainer) GetLifecyclePreUpdateCommand ¶
func (c *SimpleContainer) GetLifecyclePreUpdateCommand() string
func (*SimpleContainer) GetLifecycleUID ¶
func (c *SimpleContainer) GetLifecycleUID() (int, bool)
func (*SimpleContainer) HasImageInfo ¶
func (c *SimpleContainer) HasImageInfo() bool
func (*SimpleContainer) ID ¶
func (c *SimpleContainer) ID() types.ContainerID
func (*SimpleContainer) ImageID ¶
func (c *SimpleContainer) ImageID() types.ImageID
func (*SimpleContainer) ImageInfo ¶
func (c *SimpleContainer) ImageInfo() *dockerImage.InspectResponse
func (*SimpleContainer) ImageName ¶
func (c *SimpleContainer) ImageName() string
func (*SimpleContainer) IsLinkedToRestarting ¶
func (c *SimpleContainer) IsLinkedToRestarting() bool
func (*SimpleContainer) IsMonitorOnly ¶
func (c *SimpleContainer) IsMonitorOnly(_ types.UpdateParams) bool
func (*SimpleContainer) IsNoPull ¶
func (c *SimpleContainer) IsNoPull(_ types.UpdateParams) bool
func (*SimpleContainer) IsRestarting ¶
func (c *SimpleContainer) IsRestarting() bool
func (*SimpleContainer) IsRunning ¶
func (c *SimpleContainer) IsRunning() bool
IsRunning returns true for mock containers.
func (*SimpleContainer) IsStale ¶
func (c *SimpleContainer) IsStale() bool
func (*SimpleContainer) IsWatchtower ¶
func (c *SimpleContainer) IsWatchtower() bool
func (*SimpleContainer) Links ¶
func (c *SimpleContainer) Links() []string
func (*SimpleContainer) Name ¶
func (c *SimpleContainer) Name() string
func (*SimpleContainer) PostUpdateTimeout ¶
func (c *SimpleContainer) PostUpdateTimeout() int
func (*SimpleContainer) PreUpdateTimeout ¶
func (c *SimpleContainer) PreUpdateTimeout() int
func (*SimpleContainer) Scope ¶
func (c *SimpleContainer) Scope() (string, bool)
func (*SimpleContainer) SetLinkedToRestarting ¶
func (c *SimpleContainer) SetLinkedToRestarting(_ bool)
func (*SimpleContainer) SetStale ¶
func (c *SimpleContainer) SetStale(_ bool)
func (*SimpleContainer) StopSignal ¶
func (c *SimpleContainer) StopSignal() string
func (*SimpleContainer) StopTimeout ¶
func (c *SimpleContainer) StopTimeout() *int
StopTimeout returns the container's configured stop timeout in seconds from ContainerInfoField.
func (*SimpleContainer) ToRestart ¶
func (c *SimpleContainer) ToRestart() bool
func (*SimpleContainer) VerifyConfiguration ¶
func (c *SimpleContainer) VerifyConfiguration() error