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 ¶ 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 ¶
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 )