Help us shape the future of Go! Take the 2026 Go Developer Survey

mocks

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const NetSupplierContainerName = "/wt-contnet-producer-1"
View Source
const NetSupplierNotFoundID = "badc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc"

Variables

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

NetConsumerInvalidSupplier is used for testing `container` networking mode returns a container that references a supplying container that does not exist

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

NetConsumerOK is used for testing `container` networking mode returns a container that consumes an existing supplier container

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

Functions

func GetContainerHandler

func GetContainerHandler(containerID string, containerInfo *types.ContainerJSON) http.HandlerFunc

GetContainerHandler mocks the GET containers/{id}/json endpoint

func GetContainerHandlers

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

GetContainerHandlers returns the handlers serving lookups for the supplied container mock files

func GetImageHandler

func GetImageHandler(imageInfo *types.ImageInspect) http.HandlerFunc

GetImageHandler mocks the GET images/{id}/json endpoint

func KillContainerHandler

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

KillContainerHandler mocks the POST containers/{id}/kill endpoint

func ListContainersHandler

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

ListContainersHandler mocks the GET containers/json endpoint, filtering the returned containers based on statuses

func RemoveContainerHandler

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

RemoveContainerHandler mocks the DELETE containers/{id} endpoint

func RemoveImageHandler

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

RemoveImageHandler mocks the DELETE images/ID endpoint, simulating removal of the given imagesWithParents

func RespondWithJSONFile

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

RespondWithJSONFile handles a request by returning the contents of the supplied file

Types

type ContainerRef

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

func (*ContainerRef) ContainerID

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

type FilterableContainer

type FilterableContainer struct {
	mock.Mock
}

FilterableContainer is an autogenerated 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) 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
const (
	Found   FoundStatus = true
	Missing FoundStatus = false
)

Jump to

Keyboard shortcuts

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