client.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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/registry"
  11. "github.com/docker/docker/pkg/parsers/filters"
  12. "github.com/docker/docker/runconfig"
  13. )
  14. // apiClient is an interface that clients that talk with a docker server must implement.
  15. type apiClient interface {
  16. ContainerAttach(options types.ContainerAttachOptions) (types.HijackedResponse, error)
  17. ContainerCommit(options types.ContainerCommitOptions) (types.ContainerCommitResponse, error)
  18. ContainerCreate(config *runconfig.ContainerConfigWrapper, containerName string) (types.ContainerCreateResponse, error)
  19. ContainerDiff(containerID string) ([]types.ContainerChange, error)
  20. ContainerExecAttach(execID string, config runconfig.ExecConfig) (types.HijackedResponse, error)
  21. ContainerExecCreate(config runconfig.ExecConfig) (types.ContainerExecCreateResponse, error)
  22. ContainerExecInspect(execID string) (types.ContainerExecInspect, error)
  23. ContainerExecResize(options types.ResizeOptions) error
  24. ContainerExecStart(execID string, config types.ExecStartCheck) error
  25. ContainerExport(containerID string) (io.ReadCloser, error)
  26. ContainerInspect(containerID string) (types.ContainerJSON, error)
  27. ContainerInspectWithRaw(containerID string, getSize bool) (types.ContainerJSON, []byte, error)
  28. ContainerKill(containerID, signal string) error
  29. ContainerList(options types.ContainerListOptions) ([]types.Container, error)
  30. ContainerLogs(options types.ContainerLogsOptions) (io.ReadCloser, error)
  31. ContainerPause(containerID string) error
  32. ContainerRemove(options types.ContainerRemoveOptions) error
  33. ContainerRename(containerID, newContainerName string) error
  34. ContainerResize(options types.ResizeOptions) error
  35. ContainerRestart(containerID string, timeout int) error
  36. ContainerStatPath(containerID, path string) (types.ContainerPathStat, error)
  37. ContainerStats(containerID string, stream bool) (io.ReadCloser, error)
  38. ContainerStart(containerID string) error
  39. ContainerStop(containerID string, timeout int) error
  40. ContainerTop(containerID string, arguments []string) (types.ContainerProcessList, error)
  41. ContainerUnpause(containerID string) error
  42. ContainerWait(containerID string) (int, error)
  43. CopyFromContainer(containerID, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)
  44. CopyToContainer(options types.CopyToContainerOptions) error
  45. Events(options types.EventsOptions) (io.ReadCloser, error)
  46. ImageBuild(options types.ImageBuildOptions) (types.ImageBuildResponse, error)
  47. ImageCreate(options types.ImageCreateOptions) (io.ReadCloser, error)
  48. ImageHistory(imageID string) ([]types.ImageHistory, error)
  49. ImageImport(options types.ImageImportOptions) (io.ReadCloser, error)
  50. ImageInspectWithRaw(imageID string, getSize bool) (types.ImageInspect, []byte, error)
  51. ImageList(options types.ImageListOptions) ([]types.Image, error)
  52. ImageLoad(input io.Reader) (io.ReadCloser, error)
  53. ImagePull(options types.ImagePullOptions, privilegeFunc lib.RequestPrivilegeFunc) (io.ReadCloser, error)
  54. ImagePush(options types.ImagePushOptions, privilegeFunc lib.RequestPrivilegeFunc) (io.ReadCloser, error)
  55. ImageRemove(options types.ImageRemoveOptions) ([]types.ImageDelete, error)
  56. ImageSearch(options types.ImageSearchOptions, privilegeFunc lib.RequestPrivilegeFunc) ([]registry.SearchResult, error)
  57. ImageSave(imageIDs []string) (io.ReadCloser, error)
  58. ImageTag(options types.ImageTagOptions) error
  59. Info() (types.Info, error)
  60. NetworkConnect(networkID, containerID string) error
  61. NetworkCreate(options types.NetworkCreate) (types.NetworkCreateResponse, error)
  62. NetworkDisconnect(networkID, containerID string) error
  63. NetworkInspect(networkID string) (types.NetworkResource, error)
  64. NetworkList() ([]types.NetworkResource, error)
  65. NetworkRemove(networkID string) error
  66. RegistryLogin(auth types.AuthConfig) (types.AuthResponse, error)
  67. ServerVersion() (types.Version, error)
  68. VolumeCreate(options types.VolumeCreateRequest) (types.Volume, error)
  69. VolumeInspect(volumeID string) (types.Volume, error)
  70. VolumeList(filter filters.Args) (types.VolumesListResponse, error)
  71. VolumeRemove(volumeID string) error
  72. }