Documentation
¶
Index ¶
- Constants
- Variables
- func GetContainerHandler(containerID string, containerInfo *types.ContainerJSON) http.HandlerFunc
- func GetContainerHandlers(containerRefs ...*ContainerRef) []http.HandlerFunc
- func GetImageHandler(imageInfo *types.ImageInspect) http.HandlerFunc
- func KillContainerHandler(containerID string, found FoundStatus) http.HandlerFunc
- func ListContainersHandler(statuses ...string) http.HandlerFunc
- func RemoveContainerHandler(containerID string, found FoundStatus) http.HandlerFunc
- func RemoveImageHandler(imagesWithParents map[string][]string) http.HandlerFunc
- func RespondWithJSONFile(relPath string, statusCode int, optionalHeader ...http.Header) http.HandlerFunc
- type ContainerRef
- type FilterableContainer
- type FoundStatus
Constants ¶
const NetSupplierContainerName = "/wt-contnet-producer-1"
const NetSupplierNotFoundID = "badc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc1dbadc"
Variables ¶
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
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
var Restarting = ContainerRef{ // contains filtered or unexported fields }
var Running = ContainerRef{ // contains filtered or unexported fields }
var Stopped = ContainerRef{ // contains filtered or unexported fields }
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 ¶
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 )