mocks

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package mocks provides hand-written HTTP API fixtures and Mockery-generated doubles for container package tests.

Index

Constants

View Source
const (
	// NetSupplierNotFoundID is the mock ID for a missing network supplier container.
	NetSupplierNotFoundID = "badc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc"
	// NetSupplierContainerName is the mock Docker name for the network supplier container.
	NetSupplierContainerName = "/wt-contnet-producer-1"
)

Variables

View Source
var NetConsumerInvalidSupplier = ContainerRef{
	// contains filtered or unexported fields
}

NetConsumerInvalidSupplier is a mock container fixture referencing a non-existent network supplier.

View Source
var NetConsumerOK = ContainerRef{
	// contains filtered or unexported fields
}

NetConsumerOK is a mock container fixture consuming an existing network supplier.

View Source
var Restarting = ContainerRef{
	// contains filtered or unexported fields
}

Restarting is a mock container fixture in a restarting state.

View Source
var Running = ContainerRef{
	// contains filtered or unexported fields
}

Running is a mock container fixture in a running state with a Portainer image.

View Source
var Stopped = ContainerRef{
	// contains filtered or unexported fields
}

Stopped is a mock container fixture in a stopped state.

View Source
var Watchtower = ContainerRef{
	// contains filtered or unexported fields
}

Watchtower is a mock container fixture representing a Watchtower instance.

Functions

func GetContainerHandler

func GetContainerHandler(
	containerID string,
	containerInfo *dockerContainer.InspectResponse,
) http.HandlerFunc

GetContainerHandler returns a 404 if containerInfo is nil. Otherwise it serves the provided info.

func GetContainerHandlers

func GetContainerHandlers(containerRefs ...*ContainerRef) []http.HandlerFunc

GetContainerHandlers includes handlers for the given containers, their references, and associated images.

func GetImageHandler

func GetImageHandler(imageInfo *dockerImage.InspectResponse) http.HandlerFunc

GetImageHandler serves the provided image info as a JSON response.

func KillContainerHandler

func KillContainerHandler(containerID string, found FoundStatus) http.HandlerFunc

KillContainerHandler returns 204 if found, or 404 if not.

func ListContainersHandler

func ListContainersHandler(statuses ...string) http.HandlerFunc

ListContainersHandler filters containers by the given statuses and serves the filtered list.

func RemoveContainerHandler

func RemoveContainerHandler(containerID string, found FoundStatus) http.HandlerFunc

RemoveContainerHandler returns 204 if found, or 404 if not.

func RemoveImageHandler

func RemoveImageHandler(imagesWithParents map[string][]string) http.HandlerFunc

RemoveImageHandler simulates image removal with optional parent images. Returns 404 if not found.

func RespondWithJSONFile

func RespondWithJSONFile(
	relPath string,
	statusCode int,
	optionalHeader ...http.Header,
) http.HandlerFunc

RespondWithJSONFile expects the file to exist at the given relative path. Otherwise it fails the test.

Types

type ContainerRef

type ContainerRef struct {
	// contains filtered or unexported fields
}

ContainerRef represents a mock container with associated metadata. Includes name, ID, image reference, file path, linked containers, and existence status.

func (*ContainerRef) ContainerID

func (cr *ContainerRef) ContainerID() types.ContainerID

ContainerID returns the mock container's ID.

type FilterableContainer

type FilterableContainer struct {
	mock.Mock
}

FilterableContainer is a mock type for the FilterableContainer type.

func (*FilterableContainer) Enabled

func (_m *FilterableContainer) Enabled() (bool, bool)

Enabled provides a mock function with given fields:.

func (*FilterableContainer) GetLabel

func (_m *FilterableContainer) GetLabel(key string) (string, bool)

GetLabel provides a mock function with given fields: key.

func (*FilterableContainer) ImageName

func (_m *FilterableContainer) ImageName() string

ImageName provides a mock function with given fields:.

func (*FilterableContainer) IsWatchtower

func (_m *FilterableContainer) IsWatchtower() bool

IsWatchtower provides a mock function with given fields:.

func (*FilterableContainer) Name

func (_m *FilterableContainer) Name() string

Name provides a mock function with given fields:.

func (*FilterableContainer) Scope

func (_m *FilterableContainer) Scope() (string, bool)

Scope provides a mock function with given fields:.

type FoundStatus

type FoundStatus bool

FoundStatus indicates whether a mock container resource exists for a handler.

const (
	// Found means the mock resource exists.
	Found FoundStatus = true
	// Missing means the mock resource does not exist.
	Missing FoundStatus = false
)

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is an autogenerated mock type for the Client type

func NewMockClient

func NewMockClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockClient

NewMockClient creates a new instance of MockClient. 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 (*MockClient) CheckContainerUpdate

func (_mock *MockClient) CheckContainerUpdate(ctx context.Context, container types.Container, params types.UpdateParams) (bool, types.ImageID, string, error)

CheckContainerUpdate provides a mock function for the type MockClient

func (*MockClient) CreateContainer

func (_mock *MockClient) CreateContainer(ctx context.Context, container types.Container) (types.ContainerID, error)

CreateContainer provides a mock function for the type MockClient

func (*MockClient) CreateEphemeralOrchestrator

func (_mock *MockClient) CreateEphemeralOrchestrator(ctx context.Context, sourceContainer types.Container, newImage string, containerChain string) (types.ContainerID, error)

CreateEphemeralOrchestrator provides a mock function for the type MockClient

func (*MockClient) EXPECT

func (_m *MockClient) EXPECT() *MockClient_Expecter

func (*MockClient) ExecuteCommand

func (_mock *MockClient) ExecuteCommand(ctx context.Context, container types.Container, command string, timeout int, uid int, gid int) (bool, error)

ExecuteCommand provides a mock function for the type MockClient

func (*MockClient) GetContainer

func (_mock *MockClient) GetContainer(ctx context.Context, containerID types.ContainerID) (types.Container, error)

GetContainer provides a mock function for the type MockClient

func (*MockClient) GetCurrentWatchtowerContainer

func (_mock *MockClient) GetCurrentWatchtowerContainer(ctx context.Context, containerID types.ContainerID) (types.Container, error)

GetCurrentWatchtowerContainer provides a mock function for the type MockClient

func (*MockClient) GetInfo

func (_mock *MockClient) GetInfo(ctx context.Context) (map[string]any, error)

GetInfo provides a mock function for the type MockClient

func (*MockClient) GetVersion

func (_mock *MockClient) GetVersion() string

GetVersion provides a mock function for the type MockClient

func (*MockClient) IsContainerStale

func (_mock *MockClient) IsContainerStale(ctx context.Context, container types.Container, params types.UpdateParams) (bool, types.ImageID, string, error)

IsContainerStale provides a mock function for the type MockClient

func (*MockClient) ListContainers

func (_mock *MockClient) ListContainers(ctx context.Context, filter ...types.Filter) ([]types.Container, error)

ListContainers provides a mock function for the type MockClient

func (*MockClient) Ping

func (_mock *MockClient) Ping(ctx context.Context) error

Ping provides a mock function for the type MockClient

func (*MockClient) RemoveContainer

func (_mock *MockClient) RemoveContainer(ctx context.Context, container types.Container) error

RemoveContainer provides a mock function for the type MockClient

func (*MockClient) RemoveImageByID

func (_mock *MockClient) RemoveImageByID(ctx context.Context, imageID types.ImageID, imageName string) error

RemoveImageByID provides a mock function for the type MockClient

func (*MockClient) RenameContainer

func (_mock *MockClient) RenameContainer(ctx context.Context, container types.Container, newName string) error

RenameContainer provides a mock function for the type MockClient

func (*MockClient) SetNoRestartPolicy

func (_mock *MockClient) SetNoRestartPolicy(ctx context.Context, container types.Container)

SetNoRestartPolicy provides a mock function for the type MockClient

func (*MockClient) StartContainer

func (_mock *MockClient) StartContainer(ctx context.Context, container types.Container) (types.ContainerID, error)

StartContainer provides a mock function for the type MockClient

func (*MockClient) StartContainerByID

func (_mock *MockClient) StartContainerByID(ctx context.Context, containerID types.ContainerID) error

StartContainerByID provides a mock function for the type MockClient

func (*MockClient) StopAndRemoveContainer

func (_mock *MockClient) StopAndRemoveContainer(ctx context.Context, container types.Container, timeout time.Duration) error

StopAndRemoveContainer provides a mock function for the type MockClient

func (*MockClient) StopContainer

func (_mock *MockClient) StopContainer(ctx context.Context, container types.Container, timeout time.Duration) error

StopContainer provides a mock function for the type MockClient

func (*MockClient) UpdateContainer

func (_mock *MockClient) UpdateContainer(ctx context.Context, container1 types.Container, config container.UpdateConfig) error

UpdateContainer provides a mock function for the type MockClient

func (*MockClient) WaitForContainerHealthy

func (_mock *MockClient) WaitForContainerHealthy(ctx context.Context, containerID types.ContainerID, timeout time.Duration) error

WaitForContainerHealthy provides a mock function for the type MockClient

func (*MockClient) WarnOnHeadPullFailed

func (_mock *MockClient) WarnOnHeadPullFailed(container1 types.Container) bool

WarnOnHeadPullFailed provides a mock function for the type MockClient

type MockClient_CheckContainerUpdate_Call

type MockClient_CheckContainerUpdate_Call struct {
	*mock.Call
}

MockClient_CheckContainerUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckContainerUpdate'

func (*MockClient_CheckContainerUpdate_Call) Return

func (*MockClient_CheckContainerUpdate_Call) Run

func (*MockClient_CheckContainerUpdate_Call) RunAndReturn

type MockClient_CreateContainer_Call

type MockClient_CreateContainer_Call struct {
	*mock.Call
}

MockClient_CreateContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateContainer'

func (*MockClient_CreateContainer_Call) Return

func (*MockClient_CreateContainer_Call) Run

func (*MockClient_CreateContainer_Call) RunAndReturn

type MockClient_CreateEphemeralOrchestrator_Call

type MockClient_CreateEphemeralOrchestrator_Call struct {
	*mock.Call
}

MockClient_CreateEphemeralOrchestrator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEphemeralOrchestrator'

func (*MockClient_CreateEphemeralOrchestrator_Call) Return

func (*MockClient_CreateEphemeralOrchestrator_Call) Run

func (*MockClient_CreateEphemeralOrchestrator_Call) RunAndReturn

func (_c *MockClient_CreateEphemeralOrchestrator_Call) RunAndReturn(run func(ctx context.Context, sourceContainer types.Container, newImage string, containerChain string) (types.ContainerID, error)) *MockClient_CreateEphemeralOrchestrator_Call

type MockClient_ExecuteCommand_Call

type MockClient_ExecuteCommand_Call struct {
	*mock.Call
}

MockClient_ExecuteCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCommand'

func (*MockClient_ExecuteCommand_Call) Return

func (*MockClient_ExecuteCommand_Call) Run

func (_c *MockClient_ExecuteCommand_Call) Run(run func(ctx context.Context, container types.Container, command string, timeout int, uid int, gid int)) *MockClient_ExecuteCommand_Call

func (*MockClient_ExecuteCommand_Call) RunAndReturn

func (_c *MockClient_ExecuteCommand_Call) RunAndReturn(run func(ctx context.Context, container types.Container, command string, timeout int, uid int, gid int) (bool, error)) *MockClient_ExecuteCommand_Call

type MockClient_Expecter

type MockClient_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockClient_Expecter) CheckContainerUpdate

func (_e *MockClient_Expecter) CheckContainerUpdate(ctx any, container any, params any) *MockClient_CheckContainerUpdate_Call

CheckContainerUpdate is a helper method to define mock.On call

  • ctx context.Context
  • container types.Container
  • params types.UpdateParams

func (*MockClient_Expecter) CreateContainer

func (_e *MockClient_Expecter) CreateContainer(ctx any, container any) *MockClient_CreateContainer_Call

CreateContainer is a helper method to define mock.On call

  • ctx context.Context
  • container types.Container

func (*MockClient_Expecter) CreateEphemeralOrchestrator

func (_e *MockClient_Expecter) CreateEphemeralOrchestrator(ctx any, sourceContainer any, newImage any, containerChain any) *MockClient_CreateEphemeralOrchestrator_Call

CreateEphemeralOrchestrator is a helper method to define mock.On call

  • ctx context.Context
  • sourceContainer types.Container
  • newImage string
  • containerChain string

func (*MockClient_Expecter) ExecuteCommand

func (_e *MockClient_Expecter) ExecuteCommand(ctx any, container any, command any, timeout any, uid any, gid any) *MockClient_ExecuteCommand_Call

ExecuteCommand is a helper method to define mock.On call

  • ctx context.Context
  • container types.Container
  • command string
  • timeout int
  • uid int
  • gid int

func (*MockClient_Expecter) GetContainer

func (_e *MockClient_Expecter) GetContainer(ctx any, containerID any) *MockClient_GetContainer_Call

GetContainer is a helper method to define mock.On call

  • ctx context.Context
  • containerID types.ContainerID

func (*MockClient_Expecter) GetCurrentWatchtowerContainer

func (_e *MockClient_Expecter) GetCurrentWatchtowerContainer(ctx any, containerID any) *MockClient_GetCurrentWatchtowerContainer_Call

GetCurrentWatchtowerContainer is a helper method to define mock.On call

  • ctx context.Context
  • containerID types.ContainerID

func (*MockClient_Expecter) GetInfo

GetInfo is a helper method to define mock.On call

  • ctx context.Context

func (*MockClient_Expecter) GetVersion

GetVersion is a helper method to define mock.On call

func (*MockClient_Expecter) IsContainerStale

func (_e *MockClient_Expecter) IsContainerStale(ctx any, container any, params any) *MockClient_IsContainerStale_Call

IsContainerStale is a helper method to define mock.On call

  • ctx context.Context
  • container types.Container
  • params types.UpdateParams

func (*MockClient_Expecter) ListContainers

func (_e *MockClient_Expecter) ListContainers(ctx any, filter ...any) *MockClient_ListContainers_Call

ListContainers is a helper method to define mock.On call

  • ctx context.Context
  • filter ...types.Filter

func (*MockClient_Expecter) Ping

Ping is a helper method to define mock.On call

  • ctx context.Context

func (*MockClient_Expecter) RemoveContainer

func (_e *MockClient_Expecter) RemoveContainer(ctx any, container any) *MockClient_RemoveContainer_Call

RemoveContainer is a helper method to define mock.On call

  • ctx context.Context
  • container types.Container

func (*MockClient_Expecter) RemoveImageByID

func (_e *MockClient_Expecter) RemoveImageByID(ctx any, imageID any, imageName any) *MockClient_RemoveImageByID_Call

RemoveImageByID is a helper method to define mock.On call

  • ctx context.Context
  • imageID types.ImageID
  • imageName string

func (*MockClient_Expecter) RenameContainer

func (_e *MockClient_Expecter) RenameContainer(ctx any, container any, newName any) *MockClient_RenameContainer_Call

RenameContainer is a helper method to define mock.On call

  • ctx context.Context
  • container types.Container
  • newName string

func (*MockClient_Expecter) SetNoRestartPolicy

func (_e *MockClient_Expecter) SetNoRestartPolicy(ctx any, container any) *MockClient_SetNoRestartPolicy_Call

SetNoRestartPolicy is a helper method to define mock.On call

  • ctx context.Context
  • container types.Container

func (*MockClient_Expecter) StartContainer

func (_e *MockClient_Expecter) StartContainer(ctx any, container any) *MockClient_StartContainer_Call

StartContainer is a helper method to define mock.On call

  • ctx context.Context
  • container types.Container

func (*MockClient_Expecter) StartContainerByID

func (_e *MockClient_Expecter) StartContainerByID(ctx any, containerID any) *MockClient_StartContainerByID_Call

StartContainerByID is a helper method to define mock.On call

  • ctx context.Context
  • containerID types.ContainerID

func (*MockClient_Expecter) StopAndRemoveContainer

func (_e *MockClient_Expecter) StopAndRemoveContainer(ctx any, container any, timeout any) *MockClient_StopAndRemoveContainer_Call

StopAndRemoveContainer is a helper method to define mock.On call

  • ctx context.Context
  • container types.Container
  • timeout time.Duration

func (*MockClient_Expecter) StopContainer

func (_e *MockClient_Expecter) StopContainer(ctx any, container any, timeout any) *MockClient_StopContainer_Call

StopContainer is a helper method to define mock.On call

  • ctx context.Context
  • container types.Container
  • timeout time.Duration

func (*MockClient_Expecter) UpdateContainer

func (_e *MockClient_Expecter) UpdateContainer(ctx any, container1 any, config any) *MockClient_UpdateContainer_Call

UpdateContainer is a helper method to define mock.On call

  • ctx context.Context
  • container1 types.Container
  • config container.UpdateConfig

func (*MockClient_Expecter) WaitForContainerHealthy

func (_e *MockClient_Expecter) WaitForContainerHealthy(ctx any, containerID any, timeout any) *MockClient_WaitForContainerHealthy_Call

WaitForContainerHealthy is a helper method to define mock.On call

  • ctx context.Context
  • containerID types.ContainerID
  • timeout time.Duration

func (*MockClient_Expecter) WarnOnHeadPullFailed

func (_e *MockClient_Expecter) WarnOnHeadPullFailed(container1 any) *MockClient_WarnOnHeadPullFailed_Call

WarnOnHeadPullFailed is a helper method to define mock.On call

  • container1 types.Container

type MockClient_GetContainer_Call

type MockClient_GetContainer_Call struct {
	*mock.Call
}

MockClient_GetContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContainer'

func (*MockClient_GetContainer_Call) Return

func (*MockClient_GetContainer_Call) Run

func (*MockClient_GetContainer_Call) RunAndReturn

type MockClient_GetCurrentWatchtowerContainer_Call

type MockClient_GetCurrentWatchtowerContainer_Call struct {
	*mock.Call
}

MockClient_GetCurrentWatchtowerContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCurrentWatchtowerContainer'

func (*MockClient_GetCurrentWatchtowerContainer_Call) Return

func (*MockClient_GetCurrentWatchtowerContainer_Call) Run

func (*MockClient_GetCurrentWatchtowerContainer_Call) RunAndReturn

type MockClient_GetInfo_Call

type MockClient_GetInfo_Call struct {
	*mock.Call
}

MockClient_GetInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInfo'

func (*MockClient_GetInfo_Call) Return

func (_c *MockClient_GetInfo_Call) Return(stringToV map[string]any, err error) *MockClient_GetInfo_Call

func (*MockClient_GetInfo_Call) Run

func (*MockClient_GetInfo_Call) RunAndReturn

func (_c *MockClient_GetInfo_Call) RunAndReturn(run func(ctx context.Context) (map[string]any, error)) *MockClient_GetInfo_Call

type MockClient_GetVersion_Call

type MockClient_GetVersion_Call struct {
	*mock.Call
}

MockClient_GetVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVersion'

func (*MockClient_GetVersion_Call) Return

func (*MockClient_GetVersion_Call) Run

func (*MockClient_GetVersion_Call) RunAndReturn

func (_c *MockClient_GetVersion_Call) RunAndReturn(run func() string) *MockClient_GetVersion_Call

type MockClient_IsContainerStale_Call

type MockClient_IsContainerStale_Call struct {
	*mock.Call
}

MockClient_IsContainerStale_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsContainerStale'

func (*MockClient_IsContainerStale_Call) Return

func (*MockClient_IsContainerStale_Call) Run

func (*MockClient_IsContainerStale_Call) RunAndReturn

type MockClient_ListContainers_Call

type MockClient_ListContainers_Call struct {
	*mock.Call
}

MockClient_ListContainers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListContainers'

func (*MockClient_ListContainers_Call) Return

func (*MockClient_ListContainers_Call) Run

func (*MockClient_ListContainers_Call) RunAndReturn

type MockClient_Ping_Call

type MockClient_Ping_Call struct {
	*mock.Call
}

MockClient_Ping_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ping'

func (*MockClient_Ping_Call) Return

func (*MockClient_Ping_Call) Run

func (_c *MockClient_Ping_Call) Run(run func(ctx context.Context)) *MockClient_Ping_Call

func (*MockClient_Ping_Call) RunAndReturn

func (_c *MockClient_Ping_Call) RunAndReturn(run func(ctx context.Context) error) *MockClient_Ping_Call

type MockClient_RemoveContainer_Call

type MockClient_RemoveContainer_Call struct {
	*mock.Call
}

MockClient_RemoveContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveContainer'

func (*MockClient_RemoveContainer_Call) Return

func (*MockClient_RemoveContainer_Call) Run

func (*MockClient_RemoveContainer_Call) RunAndReturn

type MockClient_RemoveImageByID_Call

type MockClient_RemoveImageByID_Call struct {
	*mock.Call
}

MockClient_RemoveImageByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveImageByID'

func (*MockClient_RemoveImageByID_Call) Return

func (*MockClient_RemoveImageByID_Call) Run

func (*MockClient_RemoveImageByID_Call) RunAndReturn

func (_c *MockClient_RemoveImageByID_Call) RunAndReturn(run func(ctx context.Context, imageID types.ImageID, imageName string) error) *MockClient_RemoveImageByID_Call

type MockClient_RenameContainer_Call

type MockClient_RenameContainer_Call struct {
	*mock.Call
}

MockClient_RenameContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenameContainer'

func (*MockClient_RenameContainer_Call) Return

func (*MockClient_RenameContainer_Call) Run

func (*MockClient_RenameContainer_Call) RunAndReturn

func (_c *MockClient_RenameContainer_Call) RunAndReturn(run func(ctx context.Context, container types.Container, newName string) error) *MockClient_RenameContainer_Call

type MockClient_SetNoRestartPolicy_Call

type MockClient_SetNoRestartPolicy_Call struct {
	*mock.Call
}

MockClient_SetNoRestartPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNoRestartPolicy'

func (*MockClient_SetNoRestartPolicy_Call) Return

func (*MockClient_SetNoRestartPolicy_Call) Run

func (*MockClient_SetNoRestartPolicy_Call) RunAndReturn

type MockClient_StartContainerByID_Call

type MockClient_StartContainerByID_Call struct {
	*mock.Call
}

MockClient_StartContainerByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartContainerByID'

func (*MockClient_StartContainerByID_Call) Return

func (*MockClient_StartContainerByID_Call) Run

func (*MockClient_StartContainerByID_Call) RunAndReturn

type MockClient_StartContainer_Call

type MockClient_StartContainer_Call struct {
	*mock.Call
}

MockClient_StartContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartContainer'

func (*MockClient_StartContainer_Call) Return

func (*MockClient_StartContainer_Call) Run

func (*MockClient_StartContainer_Call) RunAndReturn

type MockClient_StopAndRemoveContainer_Call

type MockClient_StopAndRemoveContainer_Call struct {
	*mock.Call
}

MockClient_StopAndRemoveContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopAndRemoveContainer'

func (*MockClient_StopAndRemoveContainer_Call) Return

func (*MockClient_StopAndRemoveContainer_Call) Run

func (*MockClient_StopAndRemoveContainer_Call) RunAndReturn

type MockClient_StopContainer_Call

type MockClient_StopContainer_Call struct {
	*mock.Call
}

MockClient_StopContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopContainer'

func (*MockClient_StopContainer_Call) Return

func (*MockClient_StopContainer_Call) Run

func (*MockClient_StopContainer_Call) RunAndReturn

func (_c *MockClient_StopContainer_Call) RunAndReturn(run func(ctx context.Context, container types.Container, timeout time.Duration) error) *MockClient_StopContainer_Call

type MockClient_UpdateContainer_Call

type MockClient_UpdateContainer_Call struct {
	*mock.Call
}

MockClient_UpdateContainer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateContainer'

func (*MockClient_UpdateContainer_Call) Return

func (*MockClient_UpdateContainer_Call) Run

func (*MockClient_UpdateContainer_Call) RunAndReturn

type MockClient_WaitForContainerHealthy_Call

type MockClient_WaitForContainerHealthy_Call struct {
	*mock.Call
}

MockClient_WaitForContainerHealthy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForContainerHealthy'

func (*MockClient_WaitForContainerHealthy_Call) Return

func (*MockClient_WaitForContainerHealthy_Call) Run

func (*MockClient_WaitForContainerHealthy_Call) RunAndReturn

type MockClient_WarnOnHeadPullFailed_Call

type MockClient_WarnOnHeadPullFailed_Call struct {
	*mock.Call
}

MockClient_WarnOnHeadPullFailed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WarnOnHeadPullFailed'

func (*MockClient_WarnOnHeadPullFailed_Call) Return

func (*MockClient_WarnOnHeadPullFailed_Call) Run

func (*MockClient_WarnOnHeadPullFailed_Call) RunAndReturn

type MockOperations

type MockOperations struct {
	mock.Mock
}

MockOperations is an autogenerated mock type for the Operations type

func NewMockOperations

func NewMockOperations(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockOperations

NewMockOperations creates a new instance of MockOperations. 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 (*MockOperations) ContainerCreate

ContainerCreate provides a mock function for the type MockOperations

func (*MockOperations) ContainerInspect

func (_mock *MockOperations) ContainerInspect(ctx context.Context, containerID string, options client.ContainerInspectOptions) (client.ContainerInspectResult, error)

ContainerInspect provides a mock function for the type MockOperations

func (*MockOperations) ContainerRemove

func (_mock *MockOperations) ContainerRemove(ctx context.Context, containerID string, options client.ContainerRemoveOptions) (client.ContainerRemoveResult, error)

ContainerRemove provides a mock function for the type MockOperations

func (*MockOperations) ContainerRename

func (_mock *MockOperations) ContainerRename(ctx context.Context, containerID string, options client.ContainerRenameOptions) (client.ContainerRenameResult, error)

ContainerRename provides a mock function for the type MockOperations

func (*MockOperations) ContainerStart

func (_mock *MockOperations) ContainerStart(ctx context.Context, containerID string, options client.ContainerStartOptions) (client.ContainerStartResult, error)

ContainerStart provides a mock function for the type MockOperations

func (*MockOperations) EXPECT

func (*MockOperations) NetworkConnect

func (_mock *MockOperations) NetworkConnect(ctx context.Context, networkID string, options client.NetworkConnectOptions) (client.NetworkConnectResult, error)

NetworkConnect provides a mock function for the type MockOperations

type MockOperations_ContainerCreate_Call

type MockOperations_ContainerCreate_Call struct {
	*mock.Call
}

MockOperations_ContainerCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerCreate'

func (*MockOperations_ContainerCreate_Call) Return

func (*MockOperations_ContainerCreate_Call) Run

func (*MockOperations_ContainerCreate_Call) RunAndReturn

type MockOperations_ContainerInspect_Call

type MockOperations_ContainerInspect_Call struct {
	*mock.Call
}

MockOperations_ContainerInspect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerInspect'

func (*MockOperations_ContainerInspect_Call) Return

func (*MockOperations_ContainerInspect_Call) Run

func (*MockOperations_ContainerInspect_Call) RunAndReturn

type MockOperations_ContainerRemove_Call

type MockOperations_ContainerRemove_Call struct {
	*mock.Call
}

MockOperations_ContainerRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerRemove'

func (*MockOperations_ContainerRemove_Call) Return

func (*MockOperations_ContainerRemove_Call) Run

func (*MockOperations_ContainerRemove_Call) RunAndReturn

type MockOperations_ContainerRename_Call

type MockOperations_ContainerRename_Call struct {
	*mock.Call
}

MockOperations_ContainerRename_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerRename'

func (*MockOperations_ContainerRename_Call) Return

func (*MockOperations_ContainerRename_Call) Run

func (*MockOperations_ContainerRename_Call) RunAndReturn

type MockOperations_ContainerStart_Call

type MockOperations_ContainerStart_Call struct {
	*mock.Call
}

MockOperations_ContainerStart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerStart'

func (*MockOperations_ContainerStart_Call) Return

func (*MockOperations_ContainerStart_Call) Run

func (*MockOperations_ContainerStart_Call) RunAndReturn

type MockOperations_Expecter

type MockOperations_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockOperations_Expecter) ContainerCreate

func (_e *MockOperations_Expecter) ContainerCreate(ctx any, options any) *MockOperations_ContainerCreate_Call

ContainerCreate is a helper method to define mock.On call

  • ctx context.Context
  • options client.ContainerCreateOptions

func (*MockOperations_Expecter) ContainerInspect

func (_e *MockOperations_Expecter) ContainerInspect(ctx any, containerID any, options any) *MockOperations_ContainerInspect_Call

ContainerInspect is a helper method to define mock.On call

  • ctx context.Context
  • containerID string
  • options client.ContainerInspectOptions

func (*MockOperations_Expecter) ContainerRemove

func (_e *MockOperations_Expecter) ContainerRemove(ctx any, containerID any, options any) *MockOperations_ContainerRemove_Call

ContainerRemove is a helper method to define mock.On call

  • ctx context.Context
  • containerID string
  • options client.ContainerRemoveOptions

func (*MockOperations_Expecter) ContainerRename

func (_e *MockOperations_Expecter) ContainerRename(ctx any, containerID any, options any) *MockOperations_ContainerRename_Call

ContainerRename is a helper method to define mock.On call

  • ctx context.Context
  • containerID string
  • options client.ContainerRenameOptions

func (*MockOperations_Expecter) ContainerStart

func (_e *MockOperations_Expecter) ContainerStart(ctx any, containerID any, options any) *MockOperations_ContainerStart_Call

ContainerStart is a helper method to define mock.On call

  • ctx context.Context
  • containerID string
  • options client.ContainerStartOptions

func (*MockOperations_Expecter) NetworkConnect

func (_e *MockOperations_Expecter) NetworkConnect(ctx any, networkID any, options any) *MockOperations_NetworkConnect_Call

NetworkConnect is a helper method to define mock.On call

  • ctx context.Context
  • networkID string
  • options client.NetworkConnectOptions

type MockOperations_NetworkConnect_Call

type MockOperations_NetworkConnect_Call struct {
	*mock.Call
}

MockOperations_NetworkConnect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetworkConnect'

func (*MockOperations_NetworkConnect_Call) Return

func (*MockOperations_NetworkConnect_Call) Run

func (*MockOperations_NetworkConnect_Call) RunAndReturn

Jump to

Keyboard shortcuts

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