client.go 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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/cliconfig"
  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. ContainerExecStart(execID string, config types.ExecStartCheck) error
  24. ContainerExport(containerID string) (io.ReadCloser, error)
  25. ContainerInspect(containerID string) (types.ContainerJSON, error)
  26. ContainerInspectWithRaw(containerID string, getSize bool) (types.ContainerJSON, []byte, error)
  27. ContainerKill(containerID, signal string) error
  28. ContainerList(options types.ContainerListOptions) ([]types.Container, error)
  29. ContainerLogs(options types.ContainerLogsOptions) (io.ReadCloser, error)
  30. ContainerPause(containerID string) error
  31. ContainerRemove(options types.ContainerRemoveOptions) error
  32. ContainerRename(containerID, newContainerName string) error
  33. ContainerRestart(containerID string, timeout int) error
  34. ContainerStatPath(containerID, path string) (types.ContainerPathStat, error)
  35. ContainerStats(containerID string, stream bool) (io.ReadCloser, error)
  36. ContainerStart(containerID string) error
  37. ContainerStop(containerID string, timeout int) error
  38. ContainerTop(containerID string, arguments []string) (types.ContainerProcessList, error)
  39. ContainerUnpause(containerID string) error
  40. ContainerWait(containerID string) (int, error)
  41. CopyFromContainer(containerID, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)
  42. CopyToContainer(options types.CopyToContainerOptions) error
  43. Events(options types.EventsOptions) (io.ReadCloser, error)
  44. ImageBuild(options types.ImageBuildOptions) (types.ImageBuildResponse, error)
  45. ImageCreate(options types.ImageCreateOptions) (io.ReadCloser, error)
  46. ImageHistory(imageID string) ([]types.ImageHistory, error)
  47. ImageImport(options types.ImageImportOptions) (io.ReadCloser, error)
  48. ImageInspectWithRaw(imageID string, getSize bool) (types.ImageInspect, []byte, error)
  49. ImageList(options types.ImageListOptions) ([]types.Image, error)
  50. ImageLoad(input io.Reader) (io.ReadCloser, error)
  51. ImagePull(options types.ImagePullOptions, privilegeFunc lib.RequestPrivilegeFunc) (io.ReadCloser, error)
  52. ImagePush(options types.ImagePushOptions, privilegeFunc lib.RequestPrivilegeFunc) (io.ReadCloser, error)
  53. ImageRemove(options types.ImageRemoveOptions) ([]types.ImageDelete, error)
  54. ImageSave(imageIDs []string) (io.ReadCloser, error)
  55. ImageTag(options types.ImageTagOptions) error
  56. Info() (types.Info, error)
  57. NetworkConnect(networkID, containerID string) error
  58. NetworkCreate(options types.NetworkCreate) (types.NetworkCreateResponse, error)
  59. NetworkDisconnect(networkID, containerID string) error
  60. NetworkInspect(networkID string) (types.NetworkResource, error)
  61. NetworkList() ([]types.NetworkResource, error)
  62. NetworkRemove(networkID string) error
  63. RegistryLogin(auth cliconfig.AuthConfig) (types.AuthResponse, error)
  64. SystemVersion() (types.VersionResponse, error)
  65. VolumeCreate(options types.VolumeCreateRequest) (types.Volume, error)
  66. VolumeInspect(volumeID string) (types.Volume, error)
  67. VolumeList(filter filters.Args) (types.VolumesListResponse, error)
  68. VolumeRemove(volumeID string) error
  69. }