Documentation
¶
Overview ¶
Package mockdockerclient provides mocks for the Docker client github.com/moby/moby/client
Index ¶
- Variables
- type ContainerAPIClient
- func (c *ContainerAPIClient) ContainerAttach(context.Context, string, client.ContainerAttachOptions) (client.ContainerAttachResult, error)
- func (c *ContainerAPIClient) ContainerCommit(context.Context, string, client.ContainerCommitOptions) (client.ContainerCommitResult, error)
- func (c *ContainerAPIClient) ContainerCreate(context.Context, client.ContainerCreateOptions) (client.ContainerCreateResult, error)
- func (c *ContainerAPIClient) ContainerDiff(context.Context, string, client.ContainerDiffOptions) (client.ContainerDiffResult, error)
- func (c *ContainerAPIClient) ContainerExport(context.Context, string, client.ContainerExportOptions) (client.ContainerExportResult, error)
- func (c *ContainerAPIClient) ContainerInspect(context.Context, string, client.ContainerInspectOptions) (client.ContainerInspectResult, error)
- func (c *ContainerAPIClient) ContainerKill(context.Context, string, client.ContainerKillOptions) (client.ContainerKillResult, error)
- func (c *ContainerAPIClient) ContainerList(context.Context, client.ContainerListOptions) (client.ContainerListResult, error)
- func (c *ContainerAPIClient) ContainerLogs(context.Context, string, client.ContainerLogsOptions) (client.ContainerLogsResult, error)
- func (c *ContainerAPIClient) ContainerPause(context.Context, string, client.ContainerPauseOptions) (client.ContainerPauseResult, error)
- func (c *ContainerAPIClient) ContainerPrune(context.Context, client.ContainerPruneOptions) (client.ContainerPruneResult, error)
- func (c *ContainerAPIClient) ContainerRemove(context.Context, string, client.ContainerRemoveOptions) (client.ContainerRemoveResult, error)
- func (c *ContainerAPIClient) ContainerRename(context.Context, string, client.ContainerRenameOptions) (client.ContainerRenameResult, error)
- func (c *ContainerAPIClient) ContainerResize(context.Context, string, client.ContainerResizeOptions) (client.ContainerResizeResult, error)
- func (c *ContainerAPIClient) ContainerRestart(context.Context, string, client.ContainerRestartOptions) (client.ContainerRestartResult, error)
- func (c *ContainerAPIClient) ContainerStart(context.Context, string, client.ContainerStartOptions) (client.ContainerStartResult, error)
- func (c *ContainerAPIClient) ContainerStatPath(context.Context, string, client.ContainerStatPathOptions) (client.ContainerStatPathResult, error)
- func (c *ContainerAPIClient) ContainerStats(context.Context, string, client.ContainerStatsOptions) (client.ContainerStatsResult, error)
- func (c *ContainerAPIClient) ContainerStop(context.Context, string, client.ContainerStopOptions) (client.ContainerStopResult, error)
- func (c *ContainerAPIClient) ContainerTop(context.Context, string, client.ContainerTopOptions) (client.ContainerTopResult, error)
- func (c *ContainerAPIClient) ContainerUnpause(context.Context, string, client.ContainerUnpauseOptions) (client.ContainerUnpauseResult, error)
- func (c *ContainerAPIClient) ContainerUpdate(context.Context, string, client.ContainerUpdateOptions) (client.ContainerUpdateResult, error)
- func (c *ContainerAPIClient) ContainerWait(context.Context, string, client.ContainerWaitOptions) client.ContainerWaitResult
- func (c *ContainerAPIClient) CopyFromContainer(context.Context, string, client.CopyFromContainerOptions) (client.CopyFromContainerResult, error)
- func (c *ContainerAPIClient) CopyToContainer(context.Context, string, client.CopyToContainerOptions) (client.CopyToContainerResult, error)
- type ImageAPIClient
- func (c *ImageAPIClient) ImageAttestations(context.Context, string, ...client.ImageAttestationsOption) (client.ImageAttestationsResult, error)
- func (c *ImageAPIClient) ImageHistory(context.Context, string, ...client.ImageHistoryOption) (client.ImageHistoryResult, error)
- func (c *ImageAPIClient) ImageImport(context.Context, client.ImageImportSource, string, client.ImageImportOptions) (client.ImageImportResult, error)
- func (c *ImageAPIClient) ImageInspect(context.Context, string, ...client.ImageInspectOption) (client.ImageInspectResult, error)
- func (c *ImageAPIClient) ImageList(context.Context, client.ImageListOptions) (client.ImageListResult, error)
- func (c *ImageAPIClient) ImageLoad(context.Context, io.Reader, ...client.ImageLoadOption) (client.ImageLoadResult, error)
- func (c *ImageAPIClient) ImagePrune(context.Context, client.ImagePruneOptions) (client.ImagePruneResult, error)
- func (c *ImageAPIClient) ImagePull(context.Context, string, client.ImagePullOptions) (client.ImagePullResponse, error)
- func (c *ImageAPIClient) ImagePush(context.Context, string, client.ImagePushOptions) (client.ImagePushResponse, error)
- func (c *ImageAPIClient) ImageRemove(context.Context, string, client.ImageRemoveOptions) (client.ImageRemoveResult, error)
- func (c *ImageAPIClient) ImageSave(context.Context, []string, ...client.ImageSaveOption) (client.ImageSaveResult, error)
- func (c *ImageAPIClient) ImageSearch(context.Context, string, client.ImageSearchOptions) (client.ImageSearchResult, error)
- func (c *ImageAPIClient) ImageTag(context.Context, client.ImageTagOptions) (client.ImageTagResult, error)
- type MockCloser
- type MockImagePullResponse
- type MockReadCloser
- type MockReader
Constants ¶
This section is empty.
Variables ¶
var Err = errors.New("mockdockerclient error")
Err is the canonical error returned by mocks
Functions ¶
This section is empty.
Types ¶
type ContainerAPIClient ¶
type ContainerAPIClient struct {
CreateResp *client.ContainerCreateResult
StartErr error
StopErr error
RemoveErr error
InspectResp *client.ContainerInspectResult
Logs io.ReadCloser
}
ContainerAPIClient is a mock implementation of the Docker's client.ContainerAPIClient interface
func (*ContainerAPIClient) ContainerAttach ¶
func (c *ContainerAPIClient) ContainerAttach(context.Context, string, client.ContainerAttachOptions) (client.ContainerAttachResult, error)
ContainerAttach is a mock implementation of Docker's client.ContainerAPIClient.ContainerAttach()
TODO: properly implement
func (*ContainerAPIClient) ContainerCommit ¶
func (c *ContainerAPIClient) ContainerCommit(context.Context, string, client.ContainerCommitOptions) (client.ContainerCommitResult, error)
ContainerCommit is a mock implementation of Docker's client.ContainerAPIClient.ContainerCommit()
TODO: properly implement
func (*ContainerAPIClient) ContainerCreate ¶
func (c *ContainerAPIClient) ContainerCreate(context.Context, client.ContainerCreateOptions) (client.ContainerCreateResult, error)
ContainerCreate is a mock implementation of Docker's client.ContainerAPIClient.ContainerCreate()
func (*ContainerAPIClient) ContainerDiff ¶
func (c *ContainerAPIClient) ContainerDiff(context.Context, string, client.ContainerDiffOptions) (client.ContainerDiffResult, error)
ContainerDiff is a mock implementation of Docker's client.ContainerAPIClient.ContainerDiff()
TODO: properly implement
func (*ContainerAPIClient) ContainerExport ¶
func (c *ContainerAPIClient) ContainerExport(context.Context, string, client.ContainerExportOptions) (client.ContainerExportResult, error)
ContainerExport is a mock implementation of Docker's client.ContainerAPIClient.ContainerExport()
TODO: properly implement
func (*ContainerAPIClient) ContainerInspect ¶
func (c *ContainerAPIClient) ContainerInspect(context.Context, string, client.ContainerInspectOptions) (client.ContainerInspectResult, error)
ContainerInspect is a mock implementation of Docker's client.ContainerAPIClient.ContainerInspect()
func (*ContainerAPIClient) ContainerKill ¶
func (c *ContainerAPIClient) ContainerKill(context.Context, string, client.ContainerKillOptions) (client.ContainerKillResult, error)
ContainerKill is a mock implementation of Docker's client.ContainerAPIClient.ContainerKill()
TODO: properly implement
func (*ContainerAPIClient) ContainerList ¶
func (c *ContainerAPIClient) ContainerList(context.Context, client.ContainerListOptions) (client.ContainerListResult, error)
ContainerList is a mock implementation of Docker's client.ContainerAPIClient.ContainerList()
TODO: properly implement
func (*ContainerAPIClient) ContainerLogs ¶
func (c *ContainerAPIClient) ContainerLogs(context.Context, string, client.ContainerLogsOptions) (client.ContainerLogsResult, error)
ContainerLogs is a mock implementation of Docker's client.ContainerAPIClient.ContainerLogs()
func (*ContainerAPIClient) ContainerPause ¶
func (c *ContainerAPIClient) ContainerPause(context.Context, string, client.ContainerPauseOptions) (client.ContainerPauseResult, error)
ContainerPause is a mock implementation of Docker's client.ContainerAPIClient.ContainerPause()
TODO: properly implement
func (*ContainerAPIClient) ContainerPrune ¶
func (c *ContainerAPIClient) ContainerPrune(context.Context, client.ContainerPruneOptions) (client.ContainerPruneResult, error)
ContainerPrune is a mock implementation of Docker's client.ContainerAPIClient.ContainerPrune()
TODO: properly implement
func (*ContainerAPIClient) ContainerRemove ¶
func (c *ContainerAPIClient) ContainerRemove(context.Context, string, client.ContainerRemoveOptions) (client.ContainerRemoveResult, error)
ContainerRemove is a mock implementation of Docker's client.ContainerAPIClient.ContainerRemove()
func (*ContainerAPIClient) ContainerRename ¶
func (c *ContainerAPIClient) ContainerRename(context.Context, string, client.ContainerRenameOptions) (client.ContainerRenameResult, error)
ContainerRename is a mock implementation of Docker's client.ContainerAPIClient.ContainerRename()
TODO: properly implement
func (*ContainerAPIClient) ContainerResize ¶
func (c *ContainerAPIClient) ContainerResize(context.Context, string, client.ContainerResizeOptions) (client.ContainerResizeResult, error)
ContainerResize is a mock implementation of Docker's client.ContainerAPIClient.ContainerResize()
TODO: properly implement
func (*ContainerAPIClient) ContainerRestart ¶
func (c *ContainerAPIClient) ContainerRestart(context.Context, string, client.ContainerRestartOptions) (client.ContainerRestartResult, error)
ContainerRestart is a mock implementation of Docker's client.ContainerAPIClient.ContainerRestart()
TODO: properly implement
func (*ContainerAPIClient) ContainerStart ¶
func (c *ContainerAPIClient) ContainerStart(context.Context, string, client.ContainerStartOptions) (client.ContainerStartResult, error)
ContainerStart is a mock implementation of Docker's client.ContainerAPIClient.ContainerStart()
func (*ContainerAPIClient) ContainerStatPath ¶
func (c *ContainerAPIClient) ContainerStatPath(context.Context, string, client.ContainerStatPathOptions) (client.ContainerStatPathResult, error)
ContainerStatPath is a mock implementation of Docker's client.ContainerAPIClient.ContainerStatPath()
TODO: properly implement
func (*ContainerAPIClient) ContainerStats ¶
func (c *ContainerAPIClient) ContainerStats(context.Context, string, client.ContainerStatsOptions) (client.ContainerStatsResult, error)
ContainerStats is a mock implementation of Docker's client.ContainerAPIClient.ContainerStats()
TODO: properly implement
func (*ContainerAPIClient) ContainerStop ¶
func (c *ContainerAPIClient) ContainerStop(context.Context, string, client.ContainerStopOptions) (client.ContainerStopResult, error)
ContainerStop is a mock implementation of Docker's client.ContainerAPIClient.ContainerStop()
func (*ContainerAPIClient) ContainerTop ¶
func (c *ContainerAPIClient) ContainerTop(context.Context, string, client.ContainerTopOptions) (client.ContainerTopResult, error)
ContainerTop is a mock implementation of Docker's client.ContainerAPIClient.ContainerTop()
TODO: properly implement
func (*ContainerAPIClient) ContainerUnpause ¶
func (c *ContainerAPIClient) ContainerUnpause(context.Context, string, client.ContainerUnpauseOptions) (client.ContainerUnpauseResult, error)
ContainerUnpause is a mock implementation of Docker's client.ContainerAPIClient.ContainerUnpause()
TODO: properly implement
func (*ContainerAPIClient) ContainerUpdate ¶
func (c *ContainerAPIClient) ContainerUpdate(context.Context, string, client.ContainerUpdateOptions) (client.ContainerUpdateResult, error)
ContainerUpdate is a mock implementation of Docker's client.ContainerAPIClient.ContainerUpdate()
TODO: properly implement
func (*ContainerAPIClient) ContainerWait ¶
func (c *ContainerAPIClient) ContainerWait(context.Context, string, client.ContainerWaitOptions) client.ContainerWaitResult
ContainerWait is a mock implementation of Docker's client.ContainerAPIClient.ContainerWait()
TODO: properly implement
func (*ContainerAPIClient) CopyFromContainer ¶
func (c *ContainerAPIClient) CopyFromContainer(context.Context, string, client.CopyFromContainerOptions) (client.CopyFromContainerResult, error)
CopyFromContainer is a mock implementation of Docker's client.ContainerAPIClient.CopyFromContainer()
TODO: properly implement
func (*ContainerAPIClient) CopyToContainer ¶
func (c *ContainerAPIClient) CopyToContainer(context.Context, string, client.CopyToContainerOptions) (client.CopyToContainerResult, error)
CopyToContainer is a mock implementation of Docker's client.ContainerAPIClient.CopyToContainer()
TODO: properly implement
type ImageAPIClient ¶
type ImageAPIClient struct {
PullResp *MockImagePullResponse
}
ImageAPIClient is a mock implementation of the Docker's client.ImageAPIClient interface
func (*ImageAPIClient) ImageAttestations ¶
func (c *ImageAPIClient) ImageAttestations(context.Context, string, ...client.ImageAttestationsOption) (client.ImageAttestationsResult, error)
ImageAttestations is a mock implementation of Docker's client.ImageAPIClient.ImageAttestations()
TODO: properly implement
func (*ImageAPIClient) ImageHistory ¶
func (c *ImageAPIClient) ImageHistory(context.Context, string, ...client.ImageHistoryOption) (client.ImageHistoryResult, error)
ImageHistory is a mock implementation of Docker's client.ImageAPIClient.ImageHistory()
TODO: properly implement
func (*ImageAPIClient) ImageImport ¶
func (c *ImageAPIClient) ImageImport(context.Context, client.ImageImportSource, string, client.ImageImportOptions) (client.ImageImportResult, error)
ImageImport is a mock implementation of Docker's client.ImageAPIClient.ImageImport()
TODO: properly implement
func (*ImageAPIClient) ImageInspect ¶
func (c *ImageAPIClient) ImageInspect(context.Context, string, ...client.ImageInspectOption) (client.ImageInspectResult, error)
ImageInspect is a mock implementation of Docker's client.ImageAPIClient.ImageInspect()
TODO: properly implement
func (*ImageAPIClient) ImageList ¶
func (c *ImageAPIClient) ImageList(context.Context, client.ImageListOptions) (client.ImageListResult, error)
ImageList is a mock implementation of Docker's client.ImageAPIClient.ImageList()
TODO: properly implement
func (*ImageAPIClient) ImageLoad ¶
func (c *ImageAPIClient) ImageLoad(context.Context, io.Reader, ...client.ImageLoadOption) (client.ImageLoadResult, error)
ImageLoad is a mock implementation of Docker's client.ImageAPIClient.ImageLoad()
TODO: properly implement
func (*ImageAPIClient) ImagePrune ¶
func (c *ImageAPIClient) ImagePrune(context.Context, client.ImagePruneOptions) (client.ImagePruneResult, error)
ImagePrune is a mock implementation of Docker's client.ImageAPIClient.ImagePrune()
TODO: properly implement
func (*ImageAPIClient) ImagePull ¶
func (c *ImageAPIClient) ImagePull(context.Context, string, client.ImagePullOptions) (client.ImagePullResponse, error)
ImagePull is a mock implementation of Docker's client.ImageAPIClient.ImagePull()
func (*ImageAPIClient) ImagePush ¶
func (c *ImageAPIClient) ImagePush(context.Context, string, client.ImagePushOptions) (client.ImagePushResponse, error)
ImagePush is a mock implementation of Docker's client.ImageAPIClient.ImagePush()
TODO: properly implement
func (*ImageAPIClient) ImageRemove ¶
func (c *ImageAPIClient) ImageRemove(context.Context, string, client.ImageRemoveOptions) (client.ImageRemoveResult, error)
ImageRemove is a mock implementation of Docker's client.ImageAPIClient.ImageRemove()
TODO: properly implement
func (*ImageAPIClient) ImageSave ¶
func (c *ImageAPIClient) ImageSave(context.Context, []string, ...client.ImageSaveOption) (client.ImageSaveResult, error)
ImageSave is a mock implementation of Docker's client.ImageAPIClient.ImageSave()
TODO: properly implement
func (*ImageAPIClient) ImageSearch ¶
func (c *ImageAPIClient) ImageSearch(context.Context, string, client.ImageSearchOptions) (client.ImageSearchResult, error)
ImageSearch is a mock implementation of Docker's client.ImageAPIClient.ImageSearch() (via RegistrySearchClient)
TODO: properly implement
func (*ImageAPIClient) ImageTag ¶
func (c *ImageAPIClient) ImageTag(context.Context, client.ImageTagOptions) (client.ImageTagResult, error)
ImageTag is a mock implementation of Docker's client.ImageAPIClient.ImageTag()
TODO: properly implement
type MockCloser ¶
type MockCloser struct {
Err error
}
MockCloser is a mock implementation of the io.Closer interface
func (MockCloser) Close ¶
func (c MockCloser) Close() error
Close is a mock implementation of io.Closer.Close()
type MockImagePullResponse ¶
type MockImagePullResponse struct {
io.ReadCloser
}
MockImagePullResponse is a mock implementation of the client.ImagePullResponse interface
func (*MockImagePullResponse) JSONMessages ¶
func (ip *MockImagePullResponse) JSONMessages(context.Context) iter.Seq2[jsonstream.Message, error]
JSONMessages implements client.ImagePullResponse
type MockReadCloser ¶
type MockReadCloser struct {
MockReader
MockCloser
}
MockReadCloser is a mock implementation of the io.ReadCloser interface
type MockReader ¶
MockReader is a mock implementation of the io.Reader interface