config.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package swarm // import "github.com/docker/docker/api/types/swarm"
  2. import "os"
  3. // Config represents a config.
  4. type Config struct {
  5. ID string
  6. Meta
  7. Spec ConfigSpec
  8. }
  9. // ConfigSpec represents a config specification from a config in swarm
  10. type ConfigSpec struct {
  11. Annotations
  12. Data []byte `json:",omitempty"`
  13. // Templating controls whether and how to evaluate the config payload as
  14. // a template. If it is not set, no templating is used.
  15. Templating *Driver `json:",omitempty"`
  16. }
  17. // ConfigReferenceFileTarget is a file target in a config reference
  18. type ConfigReferenceFileTarget struct {
  19. Name string
  20. UID string
  21. GID string
  22. Mode os.FileMode
  23. }
  24. // ConfigReferenceRuntimeTarget is a target for a config specifying that it
  25. // isn't mounted into the container but instead has some other purpose.
  26. type ConfigReferenceRuntimeTarget struct{}
  27. // ConfigReference is a reference to a config in swarm
  28. type ConfigReference struct {
  29. File *ConfigReferenceFileTarget `json:",omitempty"`
  30. Runtime *ConfigReferenceRuntimeTarget `json:",omitempty"`
  31. ConfigID string
  32. ConfigName string
  33. }