secret.go 726 B

1234567891011121314151617181920212223242526272829303132
  1. package 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. }
  15. // SecretReferenceFileTarget is a file target in a secret reference
  16. type SecretReferenceFileTarget struct {
  17. Name string
  18. UID string
  19. GID string
  20. Mode os.FileMode
  21. }
  22. // SecretReference is a reference to a secret in swarm
  23. type SecretReference struct {
  24. File *SecretReferenceFileTarget
  25. SecretID string
  26. SecretName string
  27. }