client.go 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Package client provides a command-line interface for Docker.
  2. //
  3. // Run "docker help SUBCOMMAND" or "docker SUBCOMMAND --help" to see more information on any Docker subcommand, including the full list of options supported for the subcommand.
  4. // See https://docs.docker.com/installation/ for instructions on installing Docker.
  5. package client
  6. import (
  7. "io"
  8. "github.com/docker/docker/api/client/lib"
  9. "github.com/docker/docker/api/types"
  10. "github.com/docker/docker/api/types/container"
  11. "github.com/docker/docker/api/types/filters"
  12. "github.com/docker/docker/api/types/registry"
  13. )
  14. // apiClient is an interface that clients that talk with a docker server must implement.
  15. type apiClient interface {
  16. ClientVersion() string
  17. ContainerAttach(options types.ContainerAttachOptions) (types.HijackedResponse, error)
  18. ContainerCommit(options types.ContainerCommitOptions) (types.ContainerCommitResponse, error)
  19. ContainerCreate(config *container.Config, hostConfig *container.HostConfig, containerName string) (types.ContainerCreateResponse, error)
  20. ContainerDiff(containerID string) ([]types.ContainerChange, error)
  21. ContainerExecAttach(execID string, config types.ExecConfig) (types.HijackedResponse, error)
  22. ContainerExecCreate(config types.ExecConfig) (types.ContainerExecCreateResponse, error)
  23. ContainerExecInspect(execID string) (types.ContainerExecInspect, error)
  24. ContainerExecResize(options types.ResizeOptions) error
  25. ContainerExecStart(execID string, config types.ExecStartCheck) error
  26. ContainerExport(containerID string) (io.ReadCloser, error)
  27. ContainerInspect(containerID string) (types.ContainerJSON, error)
  28. ContainerInspectWithRaw(containerID string, getSize bool) (types.ContainerJSON, []byte, error)
  29. ContainerKill(containerID, signal string) error
  30. ContainerList(options types.ContainerListOptions) ([]types.Container, error)
  31. ContainerLogs(options types.ContainerLogsOptions) (io.ReadCloser, error)
  32. ContainerPause(containerID string) error
  33. ContainerRemove(options types.ContainerRemoveOptions) error
  34. ContainerRename(containerID, newContainerName string) error
  35. ContainerResize(options types.ResizeOptions) error
  36. ContainerRestart(containerID string, timeout int) error
  37. ContainerStatPath(containerID, path string) (types.ContainerPathStat, error)
  38. ContainerStats(containerID string, stream bool) (io.ReadCloser, error)
  39. ContainerStart(containerID string) error
  40. ContainerStop(containerID string, timeout int) error
  41. ContainerTop(containerID string, arguments []string) (types.ContainerProcessList, error)
  42. ContainerUnpause(containerID string) error
  43. ContainerUpdate(containerID string, hostConfig container.HostConfig) error
  44. ContainerWait(containerID string) (int, error)
  45. CopyFromContainer(containerID, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)
  46. CopyToContainer(options types.CopyToContainerOptions) error
  47. Events(options types.EventsOptions) (io.ReadCloser, error)
  48. ImageBuild(options types.ImageBuildOptions) (types.ImageBuildResponse, error)
  49. ImageCreate(options types.ImageCreateOptions) (io.ReadCloser, error)
  50. ImageHistory(imageID string) ([]types.ImageHistory, error)
  51. ImageImport(options types.ImageImportOptions) (io.ReadCloser, error)
  52. ImageInspectWithRaw(imageID string, getSize bool) (types.ImageInspect, []byte, error)
  53. ImageList(options types.ImageListOptions) ([]types.Image, error)
  54. ImageLoad(input io.Reader) (types.ImageLoadResponse, error)
  55. ImagePull(options types.ImagePullOptions, privilegeFunc lib.RequestPrivilegeFunc) (io.ReadCloser, error)
  56. ImagePush(options types.ImagePushOptions, privilegeFunc lib.RequestPrivilegeFunc) (io.ReadCloser, error)
  57. ImageRemove(options types.ImageRemoveOptions) ([]types.ImageDelete, error)
  58. ImageSearch(options types.ImageSearchOptions, privilegeFunc lib.RequestPrivilegeFunc) ([]registry.SearchResult, error)
  59. ImageSave(imageIDs []string) (io.ReadCloser, error)
  60. ImageTag(options types.ImageTagOptions) error
  61. Info() (types.Info, error)
  62. NetworkConnect(networkID, containerID string) error
  63. NetworkCreate(options types.NetworkCreate) (types.NetworkCreateResponse, error)
  64. NetworkDisconnect(networkID, containerID string) error
  65. NetworkInspect(networkID string) (types.NetworkResource, error)
  66. NetworkList(options types.NetworkListOptions) ([]types.NetworkResource, error)
  67. NetworkRemove(networkID string) error
  68. RegistryLogin(auth types.AuthConfig) (types.AuthResponse, error)
  69. ServerVersion() (types.Version, error)
  70. VolumeCreate(options types.VolumeCreateRequest) (types.Volume, error)
  71. VolumeInspect(volumeID string) (types.Volume, error)
  72. VolumeList(filter filters.Args) (types.VolumesListResponse, error)
  73. VolumeRemove(volumeID string) error
  74. }