mocks

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 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 added in v1.5.2

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

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

func GetContainerHandlers added in v1.4.0

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

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

func GetImageHandler added in v1.5.2

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

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

func KillContainerHandler added in v1.5.2

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

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

func ListContainersHandler added in v1.4.0

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

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

func RemoveContainerHandler added in v1.5.2

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

RemoveContainerHandler mocks the DELETE containers/{id} endpoint

func RemoveImageHandler added in v1.6.0

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

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

func RespondWithJSONFile added in v1.4.0

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 added in v1.6.0

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

func (*ContainerRef) ContainerID added in v1.6.0

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 added in v1.5.0

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 added in v1.0.3

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

Scope provides a mock function with given fields:

type FoundStatus added in v1.5.2

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