mocks

package
v0.0.0-...-5840427 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mocks provides mock implementations for container interfaces used in testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockSorter

type MockSorter struct {
	mock.Mock
}

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

func (*MockSorter) Sort

func (_mock *MockSorter) Sort(containers []types.Container) error

Sort provides a mock function for the type MockSorter

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

type MockSorter_Sort_Call struct {
	*mock.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 (*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 (*SimpleContainer) ImageID

func (c *SimpleContainer) ImageID() types.ImageID

func (*SimpleContainer) ImageInfo

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 (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

Jump to

Keyboard shortcuts

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