backend_unix.go 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // +build !windows
  2. package container
  3. import (
  4. "io"
  5. "time"
  6. "github.com/docker/docker/api/types"
  7. "github.com/docker/docker/api/types/versions/v1p19"
  8. "github.com/docker/docker/api/types/versions/v1p20"
  9. "github.com/docker/docker/daemon"
  10. "github.com/docker/docker/pkg/archive"
  11. "github.com/docker/docker/runconfig"
  12. )
  13. // Backend is all the methods that need to be implemented to provide
  14. // container specific functionality
  15. type Backend interface {
  16. ContainerArchivePath(name string, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error)
  17. ContainerAttachWithLogs(prefixOrName string, c *daemon.ContainerAttachWithLogsConfig) error
  18. ContainerChanges(name string) ([]archive.Change, error)
  19. ContainerCopy(name string, res string) (io.ReadCloser, error)
  20. ContainerCreate(params *daemon.ContainerCreateConfig) (types.ContainerCreateResponse, error)
  21. ContainerExecCreate(config *runconfig.ExecConfig) (string, error)
  22. ContainerExecInspect(id string) (*daemon.ExecConfig, error)
  23. ContainerExecResize(name string, height, width int) error
  24. ContainerExecStart(name string, stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) error
  25. ContainerExport(name string, out io.Writer) error
  26. ContainerExtractToDir(name, path string, noOverwriteDirNonDir bool, content io.Reader) error
  27. ContainerInspect(name string, size bool) (*types.ContainerJSON, error)
  28. ContainerInspect120(name string) (*v1p20.ContainerJSON, error)
  29. // unix version
  30. ContainerInspectPre120(name string) (*v1p19.ContainerJSON, error)
  31. // windows version
  32. //ContainerInspectPre120(name string) (*types.ContainerJSON, error)
  33. ContainerKill(name string, sig uint64) error
  34. ContainerLogs(containerName string, config *daemon.ContainerLogsConfig) error
  35. ContainerPause(name string) error
  36. ContainerRename(oldName, newName string) error
  37. ContainerResize(name string, height, width int) error
  38. ContainerRestart(name string, seconds int) error
  39. ContainerRm(name string, config *daemon.ContainerRmConfig) error
  40. Containers(config *daemon.ContainersConfig) ([]*types.Container, error)
  41. ContainerStart(name string, hostConfig *runconfig.HostConfig) error
  42. ContainerStatPath(name string, path string) (stat *types.ContainerPathStat, err error)
  43. ContainerStats(prefixOrName string, config *daemon.ContainerStatsConfig) error
  44. ContainerStop(name string, seconds int) error
  45. ContainerTop(name string, psArgs string) (*types.ContainerProcessList, error)
  46. ContainerUnpause(name string) error
  47. ContainerWait(name string, timeout time.Duration) (int, error)
  48. ContainerWsAttachWithLogs(prefixOrName string, c *daemon.ContainerWsAttachWithLogsConfig) error
  49. ExecExists(name string) (bool, error)
  50. Exists(id string) bool
  51. IsPaused(id string) bool
  52. }