common.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package swarm // import "github.com/docker/docker/api/types/swarm"
  2. import (
  3. "strconv"
  4. "time"
  5. )
  6. // Version represents the internal object version.
  7. type Version struct {
  8. Index uint64 `json:",omitempty"`
  9. }
  10. // String implements fmt.Stringer interface.
  11. func (v Version) String() string {
  12. return strconv.FormatUint(v.Index, 10)
  13. }
  14. // Meta is a base object inherited by most of the other once.
  15. type Meta struct {
  16. Version Version `json:",omitempty"`
  17. CreatedAt time.Time `json:",omitempty"`
  18. UpdatedAt time.Time `json:",omitempty"`
  19. }
  20. // Annotations represents how to describe an object.
  21. type Annotations struct {
  22. Name string `json:",omitempty"`
  23. Labels map[string]string `json:"Labels"`
  24. }
  25. // Driver represents a driver (network, logging, secrets backend).
  26. type Driver struct {
  27. Name string `json:",omitempty"`
  28. Options map[string]string `json:",omitempty"`
  29. }
  30. // TLSInfo represents the TLS information about what CA certificate is trusted,
  31. // and who the issuer for a TLS certificate is
  32. type TLSInfo struct {
  33. // TrustRoot is the trusted CA root certificate in PEM format
  34. TrustRoot string `json:",omitempty"`
  35. // CertIssuer is the raw subject bytes of the issuer
  36. CertIssuerSubject []byte `json:",omitempty"`
  37. // CertIssuerPublicKey is the raw public key bytes of the issuer
  38. CertIssuerPublicKey []byte `json:",omitempty"`
  39. }