configs.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package types // import "github.com/docker/docker/api/types"
  2. import (
  3. "github.com/docker/docker/api/types/container"
  4. "github.com/docker/docker/api/types/network"
  5. ocispec "github.com/opencontainers/image-spec/specs-go/v1"
  6. )
  7. // configs holds structs used for internal communication between the
  8. // frontend (such as an http server) and the backend (such as the
  9. // docker daemon).
  10. // ContainerCreateConfig is the parameter set to ContainerCreate()
  11. type ContainerCreateConfig struct {
  12. Name string
  13. Config *container.Config
  14. HostConfig *container.HostConfig
  15. NetworkingConfig *network.NetworkingConfig
  16. Platform *ocispec.Platform
  17. AdjustCPUShares bool
  18. }
  19. // ContainerRmConfig holds arguments for the container remove
  20. // operation. This struct is used to tell the backend what operations
  21. // to perform.
  22. type ContainerRmConfig struct {
  23. ForceRemove, RemoveVolume, RemoveLink bool
  24. }
  25. // ExecConfig is a small subset of the Config struct that holds the configuration
  26. // for the exec feature of docker.
  27. type ExecConfig struct {
  28. User string // User that will run the command
  29. Privileged bool // Is the container in privileged mode
  30. Tty bool // Attach standard streams to a tty.
  31. ConsoleSize *[2]uint `json:",omitempty"` // Initial console size [height, width]
  32. AttachStdin bool // Attach the standard input, makes possible user interaction
  33. AttachStderr bool // Attach the standard error
  34. AttachStdout bool // Attach the standard output
  35. Detach bool // Execute in detach mode
  36. DetachKeys string // Escape keys for detach
  37. Env []string // Environment variables
  38. WorkingDir string // Working directory
  39. Cmd []string // Execution commands and args
  40. }
  41. // PluginRmConfig holds arguments for plugin remove.
  42. type PluginRmConfig struct {
  43. ForceRemove bool
  44. }
  45. // PluginEnableConfig holds arguments for plugin enable
  46. type PluginEnableConfig struct {
  47. Timeout int
  48. }
  49. // PluginDisableConfig holds arguments for plugin disable.
  50. type PluginDisableConfig struct {
  51. ForceDisable bool
  52. }
  53. // NetworkListConfig stores the options available for listing networks
  54. type NetworkListConfig struct {
  55. // TODO(@cpuguy83): naming is hard, this is pulled from what was being used in the router before moving here
  56. Detailed bool
  57. Verbose bool
  58. }