secret.go 951 B

123456789101112131415161718192021222324252627282930313233343536
  1. package swarm // import "github.com/docker/docker/api/types/swarm"
  2. import "os"
  3. // Secret represents a secret.
  4. type Secret struct {
  5. ID string
  6. Meta
  7. Spec SecretSpec
  8. }
  9. // SecretSpec represents a secret specification from a secret in swarm
  10. type SecretSpec struct {
  11. Annotations
  12. Data []byte `json:",omitempty"`
  13. Driver *Driver `json:",omitempty"` // name of the secrets driver used to fetch the secret's value from an external secret store
  14. // Templating controls whether and how to evaluate the secret payload as
  15. // a template. If it is not set, no templating is used.
  16. Templating *Driver `json:",omitempty"`
  17. }
  18. // SecretReferenceFileTarget is a file target in a secret reference
  19. type SecretReferenceFileTarget struct {
  20. Name string
  21. UID string
  22. GID string
  23. Mode os.FileMode
  24. }
  25. // SecretReference is a reference to a secret in swarm
  26. type SecretReference struct {
  27. File *SecretReferenceFileTarget
  28. SecretID string
  29. SecretName string
  30. }