mocks

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockContainerService

type MockContainerService struct {
	// AttachShellCmdFunc mocks the AttachShellCmd method.
	AttachShellCmdFunc func(containerID string) *exec.Cmd

	// ComposeBuildCmdFunc mocks the ComposeBuildCmd method.
	ComposeBuildCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeDownCmdFunc mocks the ComposeDownCmd method.
	ComposeDownCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeRestartCmdFunc mocks the ComposeRestartCmd method.
	ComposeRestartCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeRmCmdFunc mocks the ComposeRmCmd method.
	ComposeRmCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeStartCmdFunc mocks the ComposeStartCmd method.
	ComposeStartCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeStopCmdFunc mocks the ComposeStopCmd method.
	ComposeStopCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeUpCmdFunc mocks the ComposeUpCmd method.
	ComposeUpCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ContainerTopFunc mocks the ContainerTop method.
	ContainerTopFunc func(ctx context.Context, containerID string) (*container.TopResponse, error)

	// ExecShellCmdFunc mocks the ExecShellCmd method.
	ExecShellCmdFunc func(containerID string) *exec.Cmd

	// InspectContainerFunc mocks the InspectContainer method.
	InspectContainerFunc func(ctx context.Context, containerID string) (*container.InspectResponse, error)

	// ListContainersFunc mocks the ListContainers method.
	ListContainersFunc func(ctx context.Context) ([]docker.ContainerInfo, error)

	// PauseContainerFunc mocks the PauseContainer method.
	PauseContainerFunc func(ctx context.Context, containerID string) error

	// PruneContainersFunc mocks the PruneContainers method.
	PruneContainersFunc func(ctx context.Context) (container.PruneReport, error)

	// RemoveContainerFunc mocks the RemoveContainer method.
	RemoveContainerFunc func(ctx context.Context, id string, opts docker.RemoveContainerOpts) error

	// RestartContainerFunc mocks the RestartContainer method.
	RestartContainerFunc func(ctx context.Context, containerID string) error

	// StartContainerFunc mocks the StartContainer method.
	StartContainerFunc func(ctx context.Context, containerID string) error

	// StopContainerFunc mocks the StopContainer method.
	StopContainerFunc func(ctx context.Context, containerID string) error

	// StreamComposeLogsFunc mocks the StreamComposeLogs method.
	StreamComposeLogsFunc func(ctx context.Context, opts docker.ComposeLogOpts) <-chan string

	// StreamContainerLogsFunc mocks the StreamContainerLogs method.
	StreamContainerLogsFunc func(ctx context.Context, containerID string, tail string) <-chan string

	// StreamContainerStatsFunc mocks the StreamContainerStats method.
	StreamContainerStatsFunc func(ctx context.Context, id string) <-chan docker.ContainerMetrics

	// UnpauseContainerFunc mocks the UnpauseContainer method.
	UnpauseContainerFunc func(ctx context.Context, containerID string) error
	// contains filtered or unexported fields
}

MockContainerService is a mock implementation of docker.ContainerService.

func TestSomethingThatUsesContainerService(t *testing.T) {

	// make and configure a mocked docker.ContainerService
	mockedContainerService := &MockContainerService{
		AttachShellCmdFunc: func(containerID string) *exec.Cmd {
			panic("mock out the AttachShellCmd method")
		},
		ComposeBuildCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeBuildCmd method")
		},
		ComposeDownCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeDownCmd method")
		},
		ComposeRestartCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeRestartCmd method")
		},
		ComposeRmCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeRmCmd method")
		},
		ComposeStartCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeStartCmd method")
		},
		ComposeStopCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeStopCmd method")
		},
		ComposeUpCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeUpCmd method")
		},
		ContainerTopFunc: func(ctx context.Context, containerID string) (*container.TopResponse, error) {
			panic("mock out the ContainerTop method")
		},
		ExecShellCmdFunc: func(containerID string) *exec.Cmd {
			panic("mock out the ExecShellCmd method")
		},
		InspectContainerFunc: func(ctx context.Context, containerID string) (*container.InspectResponse, error) {
			panic("mock out the InspectContainer method")
		},
		ListContainersFunc: func(ctx context.Context) ([]docker.ContainerInfo, error) {
			panic("mock out the ListContainers method")
		},
		PauseContainerFunc: func(ctx context.Context, containerID string) error {
			panic("mock out the PauseContainer method")
		},
		PruneContainersFunc: func(ctx context.Context) (container.PruneReport, error) {
			panic("mock out the PruneContainers method")
		},
		RemoveContainerFunc: func(ctx context.Context, id string, opts docker.RemoveContainerOpts) error {
			panic("mock out the RemoveContainer method")
		},
		RestartContainerFunc: func(ctx context.Context, containerID string) error {
			panic("mock out the RestartContainer method")
		},
		StartContainerFunc: func(ctx context.Context, containerID string) error {
			panic("mock out the StartContainer method")
		},
		StopContainerFunc: func(ctx context.Context, containerID string) error {
			panic("mock out the StopContainer method")
		},
		StreamComposeLogsFunc: func(ctx context.Context, opts docker.ComposeLogOpts) <-chan string {
			panic("mock out the StreamComposeLogs method")
		},
		StreamContainerLogsFunc: func(ctx context.Context, containerID string, tail string) <-chan string {
			panic("mock out the StreamContainerLogs method")
		},
		StreamContainerStatsFunc: func(ctx context.Context, id string) <-chan docker.ContainerMetrics {
			panic("mock out the StreamContainerStats method")
		},
		UnpauseContainerFunc: func(ctx context.Context, containerID string) error {
			panic("mock out the UnpauseContainer method")
		},
	}

	// use mockedContainerService in code that requires docker.ContainerService
	// and then make assertions.

}

func (*MockContainerService) AttachShellCmd added in v0.3.1

func (mock *MockContainerService) AttachShellCmd(containerID string) *exec.Cmd

AttachShellCmd calls AttachShellCmdFunc.

func (*MockContainerService) AttachShellCmdCalls added in v0.3.1

func (mock *MockContainerService) AttachShellCmdCalls() []struct {
	ContainerID string
}

AttachShellCmdCalls gets all the calls that were made to AttachShellCmd. Check the length with:

len(mockedContainerService.AttachShellCmdCalls())

func (*MockContainerService) ComposeBuildCmd added in v0.4.0

func (mock *MockContainerService) ComposeBuildCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeBuildCmd calls ComposeBuildCmdFunc.

func (*MockContainerService) ComposeBuildCmdCalls added in v0.4.0

func (mock *MockContainerService) ComposeBuildCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeBuildCmdCalls gets all the calls that were made to ComposeBuildCmd. Check the length with:

len(mockedContainerService.ComposeBuildCmdCalls())

func (*MockContainerService) ComposeDownCmd added in v0.4.0

func (mock *MockContainerService) ComposeDownCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeDownCmd calls ComposeDownCmdFunc.

func (*MockContainerService) ComposeDownCmdCalls added in v0.4.0

func (mock *MockContainerService) ComposeDownCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeDownCmdCalls gets all the calls that were made to ComposeDownCmd. Check the length with:

len(mockedContainerService.ComposeDownCmdCalls())

func (*MockContainerService) ComposeRestartCmd added in v0.4.0

func (mock *MockContainerService) ComposeRestartCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeRestartCmd calls ComposeRestartCmdFunc.

func (*MockContainerService) ComposeRestartCmdCalls added in v0.4.0

func (mock *MockContainerService) ComposeRestartCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeRestartCmdCalls gets all the calls that were made to ComposeRestartCmd. Check the length with:

len(mockedContainerService.ComposeRestartCmdCalls())

func (*MockContainerService) ComposeRmCmd added in v0.4.0

func (mock *MockContainerService) ComposeRmCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeRmCmd calls ComposeRmCmdFunc.

func (*MockContainerService) ComposeRmCmdCalls added in v0.4.0

func (mock *MockContainerService) ComposeRmCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeRmCmdCalls gets all the calls that were made to ComposeRmCmd. Check the length with:

len(mockedContainerService.ComposeRmCmdCalls())

func (*MockContainerService) ComposeStartCmd added in v0.4.0

func (mock *MockContainerService) ComposeStartCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeStartCmd calls ComposeStartCmdFunc.

func (*MockContainerService) ComposeStartCmdCalls added in v0.4.0

func (mock *MockContainerService) ComposeStartCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeStartCmdCalls gets all the calls that were made to ComposeStartCmd. Check the length with:

len(mockedContainerService.ComposeStartCmdCalls())

func (*MockContainerService) ComposeStopCmd added in v0.4.0

func (mock *MockContainerService) ComposeStopCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeStopCmd calls ComposeStopCmdFunc.

func (*MockContainerService) ComposeStopCmdCalls added in v0.4.0

func (mock *MockContainerService) ComposeStopCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeStopCmdCalls gets all the calls that were made to ComposeStopCmd. Check the length with:

len(mockedContainerService.ComposeStopCmdCalls())

func (*MockContainerService) ComposeUpCmd added in v0.4.0

func (mock *MockContainerService) ComposeUpCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeUpCmd calls ComposeUpCmdFunc.

func (*MockContainerService) ComposeUpCmdCalls added in v0.4.0

func (mock *MockContainerService) ComposeUpCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeUpCmdCalls gets all the calls that were made to ComposeUpCmd. Check the length with:

len(mockedContainerService.ComposeUpCmdCalls())

func (*MockContainerService) ContainerTop

func (mock *MockContainerService) ContainerTop(ctx context.Context, containerID string) (*container.TopResponse, error)

ContainerTop calls ContainerTopFunc.

func (*MockContainerService) ContainerTopCalls

func (mock *MockContainerService) ContainerTopCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

ContainerTopCalls gets all the calls that were made to ContainerTop. Check the length with:

len(mockedContainerService.ContainerTopCalls())

func (*MockContainerService) ExecShellCmd

func (mock *MockContainerService) ExecShellCmd(containerID string) *exec.Cmd

ExecShellCmd calls ExecShellCmdFunc.

func (*MockContainerService) ExecShellCmdCalls

func (mock *MockContainerService) ExecShellCmdCalls() []struct {
	ContainerID string
}

ExecShellCmdCalls gets all the calls that were made to ExecShellCmd. Check the length with:

len(mockedContainerService.ExecShellCmdCalls())

func (*MockContainerService) InspectContainer

func (mock *MockContainerService) InspectContainer(ctx context.Context, containerID string) (*container.InspectResponse, error)

InspectContainer calls InspectContainerFunc.

func (*MockContainerService) InspectContainerCalls

func (mock *MockContainerService) InspectContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

InspectContainerCalls gets all the calls that were made to InspectContainer. Check the length with:

len(mockedContainerService.InspectContainerCalls())

func (*MockContainerService) ListContainers

func (mock *MockContainerService) ListContainers(ctx context.Context) ([]docker.ContainerInfo, error)

ListContainers calls ListContainersFunc.

func (*MockContainerService) ListContainersCalls

func (mock *MockContainerService) ListContainersCalls() []struct {
	Ctx context.Context
}

ListContainersCalls gets all the calls that were made to ListContainers. Check the length with:

len(mockedContainerService.ListContainersCalls())

func (*MockContainerService) PauseContainer

func (mock *MockContainerService) PauseContainer(ctx context.Context, containerID string) error

PauseContainer calls PauseContainerFunc.

func (*MockContainerService) PauseContainerCalls

func (mock *MockContainerService) PauseContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

PauseContainerCalls gets all the calls that were made to PauseContainer. Check the length with:

len(mockedContainerService.PauseContainerCalls())

func (*MockContainerService) PruneContainers

func (mock *MockContainerService) PruneContainers(ctx context.Context) (container.PruneReport, error)

PruneContainers calls PruneContainersFunc.

func (*MockContainerService) PruneContainersCalls

func (mock *MockContainerService) PruneContainersCalls() []struct {
	Ctx context.Context
}

PruneContainersCalls gets all the calls that were made to PruneContainers. Check the length with:

len(mockedContainerService.PruneContainersCalls())

func (*MockContainerService) RemoveContainer

func (mock *MockContainerService) RemoveContainer(ctx context.Context, id string, opts docker.RemoveContainerOpts) error

RemoveContainer calls RemoveContainerFunc.

func (*MockContainerService) RemoveContainerCalls

func (mock *MockContainerService) RemoveContainerCalls() []struct {
	Ctx  context.Context
	ID   string
	Opts docker.RemoveContainerOpts
}

RemoveContainerCalls gets all the calls that were made to RemoveContainer. Check the length with:

len(mockedContainerService.RemoveContainerCalls())

func (*MockContainerService) RestartContainer

func (mock *MockContainerService) RestartContainer(ctx context.Context, containerID string) error

RestartContainer calls RestartContainerFunc.

func (*MockContainerService) RestartContainerCalls

func (mock *MockContainerService) RestartContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

RestartContainerCalls gets all the calls that were made to RestartContainer. Check the length with:

len(mockedContainerService.RestartContainerCalls())

func (*MockContainerService) StartContainer

func (mock *MockContainerService) StartContainer(ctx context.Context, containerID string) error

StartContainer calls StartContainerFunc.

func (*MockContainerService) StartContainerCalls

func (mock *MockContainerService) StartContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

StartContainerCalls gets all the calls that were made to StartContainer. Check the length with:

len(mockedContainerService.StartContainerCalls())

func (*MockContainerService) StopContainer

func (mock *MockContainerService) StopContainer(ctx context.Context, containerID string) error

StopContainer calls StopContainerFunc.

func (*MockContainerService) StopContainerCalls

func (mock *MockContainerService) StopContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

StopContainerCalls gets all the calls that were made to StopContainer. Check the length with:

len(mockedContainerService.StopContainerCalls())

func (*MockContainerService) StreamComposeLogs

func (mock *MockContainerService) StreamComposeLogs(ctx context.Context, opts docker.ComposeLogOpts) <-chan string

StreamComposeLogs calls StreamComposeLogsFunc.

func (*MockContainerService) StreamComposeLogsCalls

func (mock *MockContainerService) StreamComposeLogsCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeLogOpts
}

StreamComposeLogsCalls gets all the calls that were made to StreamComposeLogs. Check the length with:

len(mockedContainerService.StreamComposeLogsCalls())

func (*MockContainerService) StreamContainerLogs

func (mock *MockContainerService) StreamContainerLogs(ctx context.Context, containerID string, tail string) <-chan string

StreamContainerLogs calls StreamContainerLogsFunc.

func (*MockContainerService) StreamContainerLogsCalls

func (mock *MockContainerService) StreamContainerLogsCalls() []struct {
	Ctx         context.Context
	ContainerID string
	Tail        string
}

StreamContainerLogsCalls gets all the calls that were made to StreamContainerLogs. Check the length with:

len(mockedContainerService.StreamContainerLogsCalls())

func (*MockContainerService) StreamContainerStats

func (mock *MockContainerService) StreamContainerStats(ctx context.Context, id string) <-chan docker.ContainerMetrics

StreamContainerStats calls StreamContainerStatsFunc.

func (*MockContainerService) StreamContainerStatsCalls

func (mock *MockContainerService) StreamContainerStatsCalls() []struct {
	Ctx context.Context
	ID  string
}

StreamContainerStatsCalls gets all the calls that were made to StreamContainerStats. Check the length with:

len(mockedContainerService.StreamContainerStatsCalls())

func (*MockContainerService) UnpauseContainer

func (mock *MockContainerService) UnpauseContainer(ctx context.Context, containerID string) error

UnpauseContainer calls UnpauseContainerFunc.

func (*MockContainerService) UnpauseContainerCalls

func (mock *MockContainerService) UnpauseContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

UnpauseContainerCalls gets all the calls that were made to UnpauseContainer. Check the length with:

len(mockedContainerService.UnpauseContainerCalls())

type MockEventService

type MockEventService struct {
	// StreamEventsFunc mocks the StreamEvents method.
	StreamEventsFunc func(ctx context.Context) (<-chan events.Message, <-chan error)
	// contains filtered or unexported fields
}

MockEventService is a mock implementation of docker.EventService.

func TestSomethingThatUsesEventService(t *testing.T) {

	// make and configure a mocked docker.EventService
	mockedEventService := &MockEventService{
		StreamEventsFunc: func(ctx context.Context) (<-chan events.Message, <-chan error) {
			panic("mock out the StreamEvents method")
		},
	}

	// use mockedEventService in code that requires docker.EventService
	// and then make assertions.

}

func (*MockEventService) StreamEvents

func (mock *MockEventService) StreamEvents(ctx context.Context) (<-chan events.Message, <-chan error)

StreamEvents calls StreamEventsFunc.

func (*MockEventService) StreamEventsCalls

func (mock *MockEventService) StreamEventsCalls() []struct {
	Ctx context.Context
}

StreamEventsCalls gets all the calls that were made to StreamEvents. Check the length with:

len(mockedEventService.StreamEventsCalls())

type MockImageService

type MockImageService struct {
	// GetImageHistoryFunc mocks the GetImageHistory method.
	GetImageHistoryFunc func(ctx context.Context, id string) ([]docker.ImageLayer, error)

	// InspectImageFunc mocks the InspectImage method.
	InspectImageFunc func(ctx context.Context, id string) (*image.InspectResponse, error)

	// ListImagesFunc mocks the ListImages method.
	ListImagesFunc func(ctx context.Context) ([]docker.ImageInfo, error)

	// PruneImagesFunc mocks the PruneImages method.
	PruneImagesFunc func(ctx context.Context) (image.PruneReport, error)

	// RemoveImageFunc mocks the RemoveImage method.
	RemoveImageFunc func(ctx context.Context, id string, force bool) error
	// contains filtered or unexported fields
}

MockImageService is a mock implementation of docker.ImageService.

func TestSomethingThatUsesImageService(t *testing.T) {

	// make and configure a mocked docker.ImageService
	mockedImageService := &MockImageService{
		GetImageHistoryFunc: func(ctx context.Context, id string) ([]docker.ImageLayer, error) {
			panic("mock out the GetImageHistory method")
		},
		InspectImageFunc: func(ctx context.Context, id string) (*image.InspectResponse, error) {
			panic("mock out the InspectImage method")
		},
		ListImagesFunc: func(ctx context.Context) ([]docker.ImageInfo, error) {
			panic("mock out the ListImages method")
		},
		PruneImagesFunc: func(ctx context.Context) (image.PruneReport, error) {
			panic("mock out the PruneImages method")
		},
		RemoveImageFunc: func(ctx context.Context, id string, force bool) error {
			panic("mock out the RemoveImage method")
		},
	}

	// use mockedImageService in code that requires docker.ImageService
	// and then make assertions.

}

func (*MockImageService) GetImageHistory

func (mock *MockImageService) GetImageHistory(ctx context.Context, id string) ([]docker.ImageLayer, error)

GetImageHistory calls GetImageHistoryFunc.

func (*MockImageService) GetImageHistoryCalls

func (mock *MockImageService) GetImageHistoryCalls() []struct {
	Ctx context.Context
	ID  string
}

GetImageHistoryCalls gets all the calls that were made to GetImageHistory. Check the length with:

len(mockedImageService.GetImageHistoryCalls())

func (*MockImageService) InspectImage

func (mock *MockImageService) InspectImage(ctx context.Context, id string) (*image.InspectResponse, error)

InspectImage calls InspectImageFunc.

func (*MockImageService) InspectImageCalls

func (mock *MockImageService) InspectImageCalls() []struct {
	Ctx context.Context
	ID  string
}

InspectImageCalls gets all the calls that were made to InspectImage. Check the length with:

len(mockedImageService.InspectImageCalls())

func (*MockImageService) ListImages

func (mock *MockImageService) ListImages(ctx context.Context) ([]docker.ImageInfo, error)

ListImages calls ListImagesFunc.

func (*MockImageService) ListImagesCalls

func (mock *MockImageService) ListImagesCalls() []struct {
	Ctx context.Context
}

ListImagesCalls gets all the calls that were made to ListImages. Check the length with:

len(mockedImageService.ListImagesCalls())

func (*MockImageService) PruneImages

func (mock *MockImageService) PruneImages(ctx context.Context) (image.PruneReport, error)

PruneImages calls PruneImagesFunc.

func (*MockImageService) PruneImagesCalls

func (mock *MockImageService) PruneImagesCalls() []struct {
	Ctx context.Context
}

PruneImagesCalls gets all the calls that were made to PruneImages. Check the length with:

len(mockedImageService.PruneImagesCalls())

func (*MockImageService) RemoveImage

func (mock *MockImageService) RemoveImage(ctx context.Context, id string, force bool) error

RemoveImage calls RemoveImageFunc.

func (*MockImageService) RemoveImageCalls

func (mock *MockImageService) RemoveImageCalls() []struct {
	Ctx   context.Context
	ID    string
	Force bool
}

RemoveImageCalls gets all the calls that were made to RemoveImage. Check the length with:

len(mockedImageService.RemoveImageCalls())

type MockNetworkService

type MockNetworkService struct {
	// InspectNetworkFunc mocks the InspectNetwork method.
	InspectNetworkFunc func(ctx context.Context, id string) (*network.Inspect, error)

	// ListNetworksFunc mocks the ListNetworks method.
	ListNetworksFunc func(ctx context.Context) ([]docker.NetworkInfo, error)

	// PruneNetworksFunc mocks the PruneNetworks method.
	PruneNetworksFunc func(ctx context.Context) (network.PruneReport, error)

	// RemoveNetworkFunc mocks the RemoveNetwork method.
	RemoveNetworkFunc func(ctx context.Context, id string) error
	// contains filtered or unexported fields
}

MockNetworkService is a mock implementation of docker.NetworkService.

func TestSomethingThatUsesNetworkService(t *testing.T) {

	// make and configure a mocked docker.NetworkService
	mockedNetworkService := &MockNetworkService{
		InspectNetworkFunc: func(ctx context.Context, id string) (*network.Inspect, error) {
			panic("mock out the InspectNetwork method")
		},
		ListNetworksFunc: func(ctx context.Context) ([]docker.NetworkInfo, error) {
			panic("mock out the ListNetworks method")
		},
		PruneNetworksFunc: func(ctx context.Context) (network.PruneReport, error) {
			panic("mock out the PruneNetworks method")
		},
		RemoveNetworkFunc: func(ctx context.Context, id string) error {
			panic("mock out the RemoveNetwork method")
		},
	}

	// use mockedNetworkService in code that requires docker.NetworkService
	// and then make assertions.

}

func (*MockNetworkService) InspectNetwork

func (mock *MockNetworkService) InspectNetwork(ctx context.Context, id string) (*network.Inspect, error)

InspectNetwork calls InspectNetworkFunc.

func (*MockNetworkService) InspectNetworkCalls

func (mock *MockNetworkService) InspectNetworkCalls() []struct {
	Ctx context.Context
	ID  string
}

InspectNetworkCalls gets all the calls that were made to InspectNetwork. Check the length with:

len(mockedNetworkService.InspectNetworkCalls())

func (*MockNetworkService) ListNetworks

func (mock *MockNetworkService) ListNetworks(ctx context.Context) ([]docker.NetworkInfo, error)

ListNetworks calls ListNetworksFunc.

func (*MockNetworkService) ListNetworksCalls

func (mock *MockNetworkService) ListNetworksCalls() []struct {
	Ctx context.Context
}

ListNetworksCalls gets all the calls that were made to ListNetworks. Check the length with:

len(mockedNetworkService.ListNetworksCalls())

func (*MockNetworkService) PruneNetworks

func (mock *MockNetworkService) PruneNetworks(ctx context.Context) (network.PruneReport, error)

PruneNetworks calls PruneNetworksFunc.

func (*MockNetworkService) PruneNetworksCalls

func (mock *MockNetworkService) PruneNetworksCalls() []struct {
	Ctx context.Context
}

PruneNetworksCalls gets all the calls that were made to PruneNetworks. Check the length with:

len(mockedNetworkService.PruneNetworksCalls())

func (*MockNetworkService) RemoveNetwork

func (mock *MockNetworkService) RemoveNetwork(ctx context.Context, id string) error

RemoveNetwork calls RemoveNetworkFunc.

func (*MockNetworkService) RemoveNetworkCalls

func (mock *MockNetworkService) RemoveNetworkCalls() []struct {
	Ctx context.Context
	ID  string
}

RemoveNetworkCalls gets all the calls that were made to RemoveNetwork. Check the length with:

len(mockedNetworkService.RemoveNetworkCalls())

type MockService

type MockService struct {
	// AttachShellCmdFunc mocks the AttachShellCmd method.
	AttachShellCmdFunc func(containerID string) *exec.Cmd

	// CloseFunc mocks the Close method.
	CloseFunc func() error

	// ComposeBuildCmdFunc mocks the ComposeBuildCmd method.
	ComposeBuildCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeDownCmdFunc mocks the ComposeDownCmd method.
	ComposeDownCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeRestartCmdFunc mocks the ComposeRestartCmd method.
	ComposeRestartCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeRmCmdFunc mocks the ComposeRmCmd method.
	ComposeRmCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeStartCmdFunc mocks the ComposeStartCmd method.
	ComposeStartCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeStopCmdFunc mocks the ComposeStopCmd method.
	ComposeStopCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ComposeUpCmdFunc mocks the ComposeUpCmd method.
	ComposeUpCmdFunc func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

	// ContainerTopFunc mocks the ContainerTop method.
	ContainerTopFunc func(ctx context.Context, containerID string) (*container.TopResponse, error)

	// ExecShellCmdFunc mocks the ExecShellCmd method.
	ExecShellCmdFunc func(containerID string) *exec.Cmd

	// GetImageHistoryFunc mocks the GetImageHistory method.
	GetImageHistoryFunc func(ctx context.Context, id string) ([]docker.ImageLayer, error)

	// HostFunc mocks the Host method.
	HostFunc func() string

	// InspectContainerFunc mocks the InspectContainer method.
	InspectContainerFunc func(ctx context.Context, containerID string) (*container.InspectResponse, error)

	// InspectImageFunc mocks the InspectImage method.
	InspectImageFunc func(ctx context.Context, id string) (*image.InspectResponse, error)

	// InspectNetworkFunc mocks the InspectNetwork method.
	InspectNetworkFunc func(ctx context.Context, id string) (*network.Inspect, error)

	// InspectVolumeFunc mocks the InspectVolume method.
	InspectVolumeFunc func(ctx context.Context, name string) (*volume.Volume, error)

	// ListContainersFunc mocks the ListContainers method.
	ListContainersFunc func(ctx context.Context) ([]docker.ContainerInfo, error)

	// ListImagesFunc mocks the ListImages method.
	ListImagesFunc func(ctx context.Context) ([]docker.ImageInfo, error)

	// ListNetworksFunc mocks the ListNetworks method.
	ListNetworksFunc func(ctx context.Context) ([]docker.NetworkInfo, error)

	// ListVolumesFunc mocks the ListVolumes method.
	ListVolumesFunc func(ctx context.Context) ([]docker.VolumeInfo, error)

	// PauseContainerFunc mocks the PauseContainer method.
	PauseContainerFunc func(ctx context.Context, containerID string) error

	// PingFunc mocks the Ping method.
	PingFunc func() error

	// PruneContainersFunc mocks the PruneContainers method.
	PruneContainersFunc func(ctx context.Context) (container.PruneReport, error)

	// PruneImagesFunc mocks the PruneImages method.
	PruneImagesFunc func(ctx context.Context) (image.PruneReport, error)

	// PruneNetworksFunc mocks the PruneNetworks method.
	PruneNetworksFunc func(ctx context.Context) (network.PruneReport, error)

	// PruneVolumesFunc mocks the PruneVolumes method.
	PruneVolumesFunc func(ctx context.Context) (volume.PruneReport, error)

	// RemoveContainerFunc mocks the RemoveContainer method.
	RemoveContainerFunc func(ctx context.Context, id string, opts docker.RemoveContainerOpts) error

	// RemoveImageFunc mocks the RemoveImage method.
	RemoveImageFunc func(ctx context.Context, id string, force bool) error

	// RemoveNetworkFunc mocks the RemoveNetwork method.
	RemoveNetworkFunc func(ctx context.Context, id string) error

	// RemoveVolumeFunc mocks the RemoveVolume method.
	RemoveVolumeFunc func(ctx context.Context, name string, force bool) error

	// RestartContainerFunc mocks the RestartContainer method.
	RestartContainerFunc func(ctx context.Context, containerID string) error

	// StartContainerFunc mocks the StartContainer method.
	StartContainerFunc func(ctx context.Context, containerID string) error

	// StopContainerFunc mocks the StopContainer method.
	StopContainerFunc func(ctx context.Context, containerID string) error

	// StreamComposeLogsFunc mocks the StreamComposeLogs method.
	StreamComposeLogsFunc func(ctx context.Context, opts docker.ComposeLogOpts) <-chan string

	// StreamContainerLogsFunc mocks the StreamContainerLogs method.
	StreamContainerLogsFunc func(ctx context.Context, containerID string, tail string) <-chan string

	// StreamContainerStatsFunc mocks the StreamContainerStats method.
	StreamContainerStatsFunc func(ctx context.Context, id string) <-chan docker.ContainerMetrics

	// StreamEventsFunc mocks the StreamEvents method.
	StreamEventsFunc func(ctx context.Context) (<-chan events.Message, <-chan error)

	// UnpauseContainerFunc mocks the UnpauseContainer method.
	UnpauseContainerFunc func(ctx context.Context, containerID string) error
	// contains filtered or unexported fields
}

MockService is a mock implementation of docker.Service.

func TestSomethingThatUsesService(t *testing.T) {

	// make and configure a mocked docker.Service
	mockedService := &MockService{
		AttachShellCmdFunc: func(containerID string) *exec.Cmd {
			panic("mock out the AttachShellCmd method")
		},
		CloseFunc: func() error {
			panic("mock out the Close method")
		},
		ComposeBuildCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeBuildCmd method")
		},
		ComposeDownCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeDownCmd method")
		},
		ComposeRestartCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeRestartCmd method")
		},
		ComposeRmCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeRmCmd method")
		},
		ComposeStartCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeStartCmd method")
		},
		ComposeStopCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeStopCmd method")
		},
		ComposeUpCmdFunc: func(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error) {
			panic("mock out the ComposeUpCmd method")
		},
		ContainerTopFunc: func(ctx context.Context, containerID string) (*container.TopResponse, error) {
			panic("mock out the ContainerTop method")
		},
		ExecShellCmdFunc: func(containerID string) *exec.Cmd {
			panic("mock out the ExecShellCmd method")
		},
		GetImageHistoryFunc: func(ctx context.Context, id string) ([]docker.ImageLayer, error) {
			panic("mock out the GetImageHistory method")
		},
		HostFunc: func() string {
			panic("mock out the Host method")
		},
		InspectContainerFunc: func(ctx context.Context, containerID string) (*container.InspectResponse, error) {
			panic("mock out the InspectContainer method")
		},
		InspectImageFunc: func(ctx context.Context, id string) (*image.InspectResponse, error) {
			panic("mock out the InspectImage method")
		},
		InspectNetworkFunc: func(ctx context.Context, id string) (*network.Inspect, error) {
			panic("mock out the InspectNetwork method")
		},
		InspectVolumeFunc: func(ctx context.Context, name string) (*volume.Volume, error) {
			panic("mock out the InspectVolume method")
		},
		ListContainersFunc: func(ctx context.Context) ([]docker.ContainerInfo, error) {
			panic("mock out the ListContainers method")
		},
		ListImagesFunc: func(ctx context.Context) ([]docker.ImageInfo, error) {
			panic("mock out the ListImages method")
		},
		ListNetworksFunc: func(ctx context.Context) ([]docker.NetworkInfo, error) {
			panic("mock out the ListNetworks method")
		},
		ListVolumesFunc: func(ctx context.Context) ([]docker.VolumeInfo, error) {
			panic("mock out the ListVolumes method")
		},
		PauseContainerFunc: func(ctx context.Context, containerID string) error {
			panic("mock out the PauseContainer method")
		},
		PingFunc: func() error {
			panic("mock out the Ping method")
		},
		PruneContainersFunc: func(ctx context.Context) (container.PruneReport, error) {
			panic("mock out the PruneContainers method")
		},
		PruneImagesFunc: func(ctx context.Context) (image.PruneReport, error) {
			panic("mock out the PruneImages method")
		},
		PruneNetworksFunc: func(ctx context.Context) (network.PruneReport, error) {
			panic("mock out the PruneNetworks method")
		},
		PruneVolumesFunc: func(ctx context.Context) (volume.PruneReport, error) {
			panic("mock out the PruneVolumes method")
		},
		RemoveContainerFunc: func(ctx context.Context, id string, opts docker.RemoveContainerOpts) error {
			panic("mock out the RemoveContainer method")
		},
		RemoveImageFunc: func(ctx context.Context, id string, force bool) error {
			panic("mock out the RemoveImage method")
		},
		RemoveNetworkFunc: func(ctx context.Context, id string) error {
			panic("mock out the RemoveNetwork method")
		},
		RemoveVolumeFunc: func(ctx context.Context, name string, force bool) error {
			panic("mock out the RemoveVolume method")
		},
		RestartContainerFunc: func(ctx context.Context, containerID string) error {
			panic("mock out the RestartContainer method")
		},
		StartContainerFunc: func(ctx context.Context, containerID string) error {
			panic("mock out the StartContainer method")
		},
		StopContainerFunc: func(ctx context.Context, containerID string) error {
			panic("mock out the StopContainer method")
		},
		StreamComposeLogsFunc: func(ctx context.Context, opts docker.ComposeLogOpts) <-chan string {
			panic("mock out the StreamComposeLogs method")
		},
		StreamContainerLogsFunc: func(ctx context.Context, containerID string, tail string) <-chan string {
			panic("mock out the StreamContainerLogs method")
		},
		StreamContainerStatsFunc: func(ctx context.Context, id string) <-chan docker.ContainerMetrics {
			panic("mock out the StreamContainerStats method")
		},
		StreamEventsFunc: func(ctx context.Context) (<-chan events.Message, <-chan error) {
			panic("mock out the StreamEvents method")
		},
		UnpauseContainerFunc: func(ctx context.Context, containerID string) error {
			panic("mock out the UnpauseContainer method")
		},
	}

	// use mockedService in code that requires docker.Service
	// and then make assertions.

}

func (*MockService) AttachShellCmd added in v0.3.1

func (mock *MockService) AttachShellCmd(containerID string) *exec.Cmd

AttachShellCmd calls AttachShellCmdFunc.

func (*MockService) AttachShellCmdCalls added in v0.3.1

func (mock *MockService) AttachShellCmdCalls() []struct {
	ContainerID string
}

AttachShellCmdCalls gets all the calls that were made to AttachShellCmd. Check the length with:

len(mockedService.AttachShellCmdCalls())

func (*MockService) Close

func (mock *MockService) Close() error

Close calls CloseFunc.

func (*MockService) CloseCalls

func (mock *MockService) CloseCalls() []struct {
}

CloseCalls gets all the calls that were made to Close. Check the length with:

len(mockedService.CloseCalls())

func (*MockService) ComposeBuildCmd added in v0.4.0

func (mock *MockService) ComposeBuildCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeBuildCmd calls ComposeBuildCmdFunc.

func (*MockService) ComposeBuildCmdCalls added in v0.4.0

func (mock *MockService) ComposeBuildCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeBuildCmdCalls gets all the calls that were made to ComposeBuildCmd. Check the length with:

len(mockedService.ComposeBuildCmdCalls())

func (*MockService) ComposeDownCmd added in v0.4.0

func (mock *MockService) ComposeDownCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeDownCmd calls ComposeDownCmdFunc.

func (*MockService) ComposeDownCmdCalls added in v0.4.0

func (mock *MockService) ComposeDownCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeDownCmdCalls gets all the calls that were made to ComposeDownCmd. Check the length with:

len(mockedService.ComposeDownCmdCalls())

func (*MockService) ComposeRestartCmd added in v0.4.0

func (mock *MockService) ComposeRestartCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeRestartCmd calls ComposeRestartCmdFunc.

func (*MockService) ComposeRestartCmdCalls added in v0.4.0

func (mock *MockService) ComposeRestartCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeRestartCmdCalls gets all the calls that were made to ComposeRestartCmd. Check the length with:

len(mockedService.ComposeRestartCmdCalls())

func (*MockService) ComposeRmCmd added in v0.4.0

func (mock *MockService) ComposeRmCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeRmCmd calls ComposeRmCmdFunc.

func (*MockService) ComposeRmCmdCalls added in v0.4.0

func (mock *MockService) ComposeRmCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeRmCmdCalls gets all the calls that were made to ComposeRmCmd. Check the length with:

len(mockedService.ComposeRmCmdCalls())

func (*MockService) ComposeStartCmd added in v0.4.0

func (mock *MockService) ComposeStartCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeStartCmd calls ComposeStartCmdFunc.

func (*MockService) ComposeStartCmdCalls added in v0.4.0

func (mock *MockService) ComposeStartCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeStartCmdCalls gets all the calls that were made to ComposeStartCmd. Check the length with:

len(mockedService.ComposeStartCmdCalls())

func (*MockService) ComposeStopCmd added in v0.4.0

func (mock *MockService) ComposeStopCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeStopCmd calls ComposeStopCmdFunc.

func (*MockService) ComposeStopCmdCalls added in v0.4.0

func (mock *MockService) ComposeStopCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeStopCmdCalls gets all the calls that were made to ComposeStopCmd. Check the length with:

len(mockedService.ComposeStopCmdCalls())

func (*MockService) ComposeUpCmd added in v0.4.0

func (mock *MockService) ComposeUpCmd(ctx context.Context, opts docker.ComposeOpts) (*exec.Cmd, error)

ComposeUpCmd calls ComposeUpCmdFunc.

func (*MockService) ComposeUpCmdCalls added in v0.4.0

func (mock *MockService) ComposeUpCmdCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeOpts
}

ComposeUpCmdCalls gets all the calls that were made to ComposeUpCmd. Check the length with:

len(mockedService.ComposeUpCmdCalls())

func (*MockService) ContainerTop

func (mock *MockService) ContainerTop(ctx context.Context, containerID string) (*container.TopResponse, error)

ContainerTop calls ContainerTopFunc.

func (*MockService) ContainerTopCalls

func (mock *MockService) ContainerTopCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

ContainerTopCalls gets all the calls that were made to ContainerTop. Check the length with:

len(mockedService.ContainerTopCalls())

func (*MockService) ExecShellCmd

func (mock *MockService) ExecShellCmd(containerID string) *exec.Cmd

ExecShellCmd calls ExecShellCmdFunc.

func (*MockService) ExecShellCmdCalls

func (mock *MockService) ExecShellCmdCalls() []struct {
	ContainerID string
}

ExecShellCmdCalls gets all the calls that were made to ExecShellCmd. Check the length with:

len(mockedService.ExecShellCmdCalls())

func (*MockService) GetImageHistory

func (mock *MockService) GetImageHistory(ctx context.Context, id string) ([]docker.ImageLayer, error)

GetImageHistory calls GetImageHistoryFunc.

func (*MockService) GetImageHistoryCalls

func (mock *MockService) GetImageHistoryCalls() []struct {
	Ctx context.Context
	ID  string
}

GetImageHistoryCalls gets all the calls that were made to GetImageHistory. Check the length with:

len(mockedService.GetImageHistoryCalls())

func (*MockService) Host added in v0.3.0

func (mock *MockService) Host() string

Host calls HostFunc.

func (*MockService) HostCalls added in v0.3.0

func (mock *MockService) HostCalls() []struct {
}

HostCalls gets all the calls that were made to Host. Check the length with:

len(mockedService.HostCalls())

func (*MockService) InspectContainer

func (mock *MockService) InspectContainer(ctx context.Context, containerID string) (*container.InspectResponse, error)

InspectContainer calls InspectContainerFunc.

func (*MockService) InspectContainerCalls

func (mock *MockService) InspectContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

InspectContainerCalls gets all the calls that were made to InspectContainer. Check the length with:

len(mockedService.InspectContainerCalls())

func (*MockService) InspectImage

func (mock *MockService) InspectImage(ctx context.Context, id string) (*image.InspectResponse, error)

InspectImage calls InspectImageFunc.

func (*MockService) InspectImageCalls

func (mock *MockService) InspectImageCalls() []struct {
	Ctx context.Context
	ID  string
}

InspectImageCalls gets all the calls that were made to InspectImage. Check the length with:

len(mockedService.InspectImageCalls())

func (*MockService) InspectNetwork

func (mock *MockService) InspectNetwork(ctx context.Context, id string) (*network.Inspect, error)

InspectNetwork calls InspectNetworkFunc.

func (*MockService) InspectNetworkCalls

func (mock *MockService) InspectNetworkCalls() []struct {
	Ctx context.Context
	ID  string
}

InspectNetworkCalls gets all the calls that were made to InspectNetwork. Check the length with:

len(mockedService.InspectNetworkCalls())

func (*MockService) InspectVolume

func (mock *MockService) InspectVolume(ctx context.Context, name string) (*volume.Volume, error)

InspectVolume calls InspectVolumeFunc.

func (*MockService) InspectVolumeCalls

func (mock *MockService) InspectVolumeCalls() []struct {
	Ctx  context.Context
	Name string
}

InspectVolumeCalls gets all the calls that were made to InspectVolume. Check the length with:

len(mockedService.InspectVolumeCalls())

func (*MockService) ListContainers

func (mock *MockService) ListContainers(ctx context.Context) ([]docker.ContainerInfo, error)

ListContainers calls ListContainersFunc.

func (*MockService) ListContainersCalls

func (mock *MockService) ListContainersCalls() []struct {
	Ctx context.Context
}

ListContainersCalls gets all the calls that were made to ListContainers. Check the length with:

len(mockedService.ListContainersCalls())

func (*MockService) ListImages

func (mock *MockService) ListImages(ctx context.Context) ([]docker.ImageInfo, error)

ListImages calls ListImagesFunc.

func (*MockService) ListImagesCalls

func (mock *MockService) ListImagesCalls() []struct {
	Ctx context.Context
}

ListImagesCalls gets all the calls that were made to ListImages. Check the length with:

len(mockedService.ListImagesCalls())

func (*MockService) ListNetworks

func (mock *MockService) ListNetworks(ctx context.Context) ([]docker.NetworkInfo, error)

ListNetworks calls ListNetworksFunc.

func (*MockService) ListNetworksCalls

func (mock *MockService) ListNetworksCalls() []struct {
	Ctx context.Context
}

ListNetworksCalls gets all the calls that were made to ListNetworks. Check the length with:

len(mockedService.ListNetworksCalls())

func (*MockService) ListVolumes

func (mock *MockService) ListVolumes(ctx context.Context) ([]docker.VolumeInfo, error)

ListVolumes calls ListVolumesFunc.

func (*MockService) ListVolumesCalls

func (mock *MockService) ListVolumesCalls() []struct {
	Ctx context.Context
}

ListVolumesCalls gets all the calls that were made to ListVolumes. Check the length with:

len(mockedService.ListVolumesCalls())

func (*MockService) PauseContainer

func (mock *MockService) PauseContainer(ctx context.Context, containerID string) error

PauseContainer calls PauseContainerFunc.

func (*MockService) PauseContainerCalls

func (mock *MockService) PauseContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

PauseContainerCalls gets all the calls that were made to PauseContainer. Check the length with:

len(mockedService.PauseContainerCalls())

func (*MockService) Ping

func (mock *MockService) Ping() error

Ping calls PingFunc.

func (*MockService) PingCalls

func (mock *MockService) PingCalls() []struct {
}

PingCalls gets all the calls that were made to Ping. Check the length with:

len(mockedService.PingCalls())

func (*MockService) PruneContainers

func (mock *MockService) PruneContainers(ctx context.Context) (container.PruneReport, error)

PruneContainers calls PruneContainersFunc.

func (*MockService) PruneContainersCalls

func (mock *MockService) PruneContainersCalls() []struct {
	Ctx context.Context
}

PruneContainersCalls gets all the calls that were made to PruneContainers. Check the length with:

len(mockedService.PruneContainersCalls())

func (*MockService) PruneImages

func (mock *MockService) PruneImages(ctx context.Context) (image.PruneReport, error)

PruneImages calls PruneImagesFunc.

func (*MockService) PruneImagesCalls

func (mock *MockService) PruneImagesCalls() []struct {
	Ctx context.Context
}

PruneImagesCalls gets all the calls that were made to PruneImages. Check the length with:

len(mockedService.PruneImagesCalls())

func (*MockService) PruneNetworks

func (mock *MockService) PruneNetworks(ctx context.Context) (network.PruneReport, error)

PruneNetworks calls PruneNetworksFunc.

func (*MockService) PruneNetworksCalls

func (mock *MockService) PruneNetworksCalls() []struct {
	Ctx context.Context
}

PruneNetworksCalls gets all the calls that were made to PruneNetworks. Check the length with:

len(mockedService.PruneNetworksCalls())

func (*MockService) PruneVolumes

func (mock *MockService) PruneVolumes(ctx context.Context) (volume.PruneReport, error)

PruneVolumes calls PruneVolumesFunc.

func (*MockService) PruneVolumesCalls

func (mock *MockService) PruneVolumesCalls() []struct {
	Ctx context.Context
}

PruneVolumesCalls gets all the calls that were made to PruneVolumes. Check the length with:

len(mockedService.PruneVolumesCalls())

func (*MockService) RemoveContainer

func (mock *MockService) RemoveContainer(ctx context.Context, id string, opts docker.RemoveContainerOpts) error

RemoveContainer calls RemoveContainerFunc.

func (*MockService) RemoveContainerCalls

func (mock *MockService) RemoveContainerCalls() []struct {
	Ctx  context.Context
	ID   string
	Opts docker.RemoveContainerOpts
}

RemoveContainerCalls gets all the calls that were made to RemoveContainer. Check the length with:

len(mockedService.RemoveContainerCalls())

func (*MockService) RemoveImage

func (mock *MockService) RemoveImage(ctx context.Context, id string, force bool) error

RemoveImage calls RemoveImageFunc.

func (*MockService) RemoveImageCalls

func (mock *MockService) RemoveImageCalls() []struct {
	Ctx   context.Context
	ID    string
	Force bool
}

RemoveImageCalls gets all the calls that were made to RemoveImage. Check the length with:

len(mockedService.RemoveImageCalls())

func (*MockService) RemoveNetwork

func (mock *MockService) RemoveNetwork(ctx context.Context, id string) error

RemoveNetwork calls RemoveNetworkFunc.

func (*MockService) RemoveNetworkCalls

func (mock *MockService) RemoveNetworkCalls() []struct {
	Ctx context.Context
	ID  string
}

RemoveNetworkCalls gets all the calls that were made to RemoveNetwork. Check the length with:

len(mockedService.RemoveNetworkCalls())

func (*MockService) RemoveVolume

func (mock *MockService) RemoveVolume(ctx context.Context, name string, force bool) error

RemoveVolume calls RemoveVolumeFunc.

func (*MockService) RemoveVolumeCalls

func (mock *MockService) RemoveVolumeCalls() []struct {
	Ctx   context.Context
	Name  string
	Force bool
}

RemoveVolumeCalls gets all the calls that were made to RemoveVolume. Check the length with:

len(mockedService.RemoveVolumeCalls())

func (*MockService) RestartContainer

func (mock *MockService) RestartContainer(ctx context.Context, containerID string) error

RestartContainer calls RestartContainerFunc.

func (*MockService) RestartContainerCalls

func (mock *MockService) RestartContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

RestartContainerCalls gets all the calls that were made to RestartContainer. Check the length with:

len(mockedService.RestartContainerCalls())

func (*MockService) StartContainer

func (mock *MockService) StartContainer(ctx context.Context, containerID string) error

StartContainer calls StartContainerFunc.

func (*MockService) StartContainerCalls

func (mock *MockService) StartContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

StartContainerCalls gets all the calls that were made to StartContainer. Check the length with:

len(mockedService.StartContainerCalls())

func (*MockService) StopContainer

func (mock *MockService) StopContainer(ctx context.Context, containerID string) error

StopContainer calls StopContainerFunc.

func (*MockService) StopContainerCalls

func (mock *MockService) StopContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

StopContainerCalls gets all the calls that were made to StopContainer. Check the length with:

len(mockedService.StopContainerCalls())

func (*MockService) StreamComposeLogs

func (mock *MockService) StreamComposeLogs(ctx context.Context, opts docker.ComposeLogOpts) <-chan string

StreamComposeLogs calls StreamComposeLogsFunc.

func (*MockService) StreamComposeLogsCalls

func (mock *MockService) StreamComposeLogsCalls() []struct {
	Ctx  context.Context
	Opts docker.ComposeLogOpts
}

StreamComposeLogsCalls gets all the calls that were made to StreamComposeLogs. Check the length with:

len(mockedService.StreamComposeLogsCalls())

func (*MockService) StreamContainerLogs

func (mock *MockService) StreamContainerLogs(ctx context.Context, containerID string, tail string) <-chan string

StreamContainerLogs calls StreamContainerLogsFunc.

func (*MockService) StreamContainerLogsCalls

func (mock *MockService) StreamContainerLogsCalls() []struct {
	Ctx         context.Context
	ContainerID string
	Tail        string
}

StreamContainerLogsCalls gets all the calls that were made to StreamContainerLogs. Check the length with:

len(mockedService.StreamContainerLogsCalls())

func (*MockService) StreamContainerStats

func (mock *MockService) StreamContainerStats(ctx context.Context, id string) <-chan docker.ContainerMetrics

StreamContainerStats calls StreamContainerStatsFunc.

func (*MockService) StreamContainerStatsCalls

func (mock *MockService) StreamContainerStatsCalls() []struct {
	Ctx context.Context
	ID  string
}

StreamContainerStatsCalls gets all the calls that were made to StreamContainerStats. Check the length with:

len(mockedService.StreamContainerStatsCalls())

func (*MockService) StreamEvents

func (mock *MockService) StreamEvents(ctx context.Context) (<-chan events.Message, <-chan error)

StreamEvents calls StreamEventsFunc.

func (*MockService) StreamEventsCalls

func (mock *MockService) StreamEventsCalls() []struct {
	Ctx context.Context
}

StreamEventsCalls gets all the calls that were made to StreamEvents. Check the length with:

len(mockedService.StreamEventsCalls())

func (*MockService) UnpauseContainer

func (mock *MockService) UnpauseContainer(ctx context.Context, containerID string) error

UnpauseContainer calls UnpauseContainerFunc.

func (*MockService) UnpauseContainerCalls

func (mock *MockService) UnpauseContainerCalls() []struct {
	Ctx         context.Context
	ContainerID string
}

UnpauseContainerCalls gets all the calls that were made to UnpauseContainer. Check the length with:

len(mockedService.UnpauseContainerCalls())

type MockVolumeService

type MockVolumeService struct {
	// InspectVolumeFunc mocks the InspectVolume method.
	InspectVolumeFunc func(ctx context.Context, name string) (*volume.Volume, error)

	// ListVolumesFunc mocks the ListVolumes method.
	ListVolumesFunc func(ctx context.Context) ([]docker.VolumeInfo, error)

	// PruneVolumesFunc mocks the PruneVolumes method.
	PruneVolumesFunc func(ctx context.Context) (volume.PruneReport, error)

	// RemoveVolumeFunc mocks the RemoveVolume method.
	RemoveVolumeFunc func(ctx context.Context, name string, force bool) error
	// contains filtered or unexported fields
}

MockVolumeService is a mock implementation of docker.VolumeService.

func TestSomethingThatUsesVolumeService(t *testing.T) {

	// make and configure a mocked docker.VolumeService
	mockedVolumeService := &MockVolumeService{
		InspectVolumeFunc: func(ctx context.Context, name string) (*volume.Volume, error) {
			panic("mock out the InspectVolume method")
		},
		ListVolumesFunc: func(ctx context.Context) ([]docker.VolumeInfo, error) {
			panic("mock out the ListVolumes method")
		},
		PruneVolumesFunc: func(ctx context.Context) (volume.PruneReport, error) {
			panic("mock out the PruneVolumes method")
		},
		RemoveVolumeFunc: func(ctx context.Context, name string, force bool) error {
			panic("mock out the RemoveVolume method")
		},
	}

	// use mockedVolumeService in code that requires docker.VolumeService
	// and then make assertions.

}

func (*MockVolumeService) InspectVolume

func (mock *MockVolumeService) InspectVolume(ctx context.Context, name string) (*volume.Volume, error)

InspectVolume calls InspectVolumeFunc.

func (*MockVolumeService) InspectVolumeCalls

func (mock *MockVolumeService) InspectVolumeCalls() []struct {
	Ctx  context.Context
	Name string
}

InspectVolumeCalls gets all the calls that were made to InspectVolume. Check the length with:

len(mockedVolumeService.InspectVolumeCalls())

func (*MockVolumeService) ListVolumes

func (mock *MockVolumeService) ListVolumes(ctx context.Context) ([]docker.VolumeInfo, error)

ListVolumes calls ListVolumesFunc.

func (*MockVolumeService) ListVolumesCalls

func (mock *MockVolumeService) ListVolumesCalls() []struct {
	Ctx context.Context
}

ListVolumesCalls gets all the calls that were made to ListVolumes. Check the length with:

len(mockedVolumeService.ListVolumesCalls())

func (*MockVolumeService) PruneVolumes

func (mock *MockVolumeService) PruneVolumes(ctx context.Context) (volume.PruneReport, error)

PruneVolumes calls PruneVolumesFunc.

func (*MockVolumeService) PruneVolumesCalls

func (mock *MockVolumeService) PruneVolumesCalls() []struct {
	Ctx context.Context
}

PruneVolumesCalls gets all the calls that were made to PruneVolumes. Check the length with:

len(mockedVolumeService.PruneVolumesCalls())

func (*MockVolumeService) RemoveVolume

func (mock *MockVolumeService) RemoveVolume(ctx context.Context, name string, force bool) error

RemoveVolume calls RemoveVolumeFunc.

func (*MockVolumeService) RemoveVolumeCalls

func (mock *MockVolumeService) RemoveVolumeCalls() []struct {
	Ctx   context.Context
	Name  string
	Force bool
}

RemoveVolumeCalls gets all the calls that were made to RemoveVolume. Check the length with:

len(mockedVolumeService.RemoveVolumeCalls())

Jump to

Keyboard shortcuts

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