Docker template generator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

model.go 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package model
  2. import "time"
  3. // CertActions define what will be done with a certificate
  4. type CertActions uint8
  5. // constants defining CertActions
  6. const (
  7. // COMBINE the full chain and private key into one file
  8. COMBINE CertActions = 1 << iota
  9. // FLATTEN the directory structure so all files are in one dir
  10. FLATTEN
  11. // CHMOD the files so they are world readable (potentially dangerous!)
  12. CHMOD
  13. )
  14. // Container models a docker container that is running on the system.
  15. type Container struct {
  16. Id string
  17. Name string
  18. Labels map[string]string
  19. }
  20. // LabelConfig describes the labels used for various properties.
  21. type LabelConfig struct {
  22. Hostnames string
  23. }
  24. // Hostname describes a DNS name used for proxying, retrieving certificates, etc.
  25. type Hostname struct {
  26. Name string
  27. Alternatives map[string]bool
  28. Containers []Container
  29. CertActions CertActions
  30. CertDestination string
  31. }
  32. // Config is the user-definable configuration for Dotege.
  33. type Config struct {
  34. Templates []TemplateConfig
  35. Labels LabelConfig
  36. DefaultCertActions CertActions
  37. DefaultCertDestination string
  38. }
  39. // TemplateConfig configures a single template for the generator.
  40. type TemplateConfig struct {
  41. Source string
  42. Destination string
  43. }
  44. // FoundCertificate describes a certificate we've located on disk.
  45. type FoundCertificate struct {
  46. Cert string
  47. Chain string
  48. FullChain string
  49. PrivateKey string
  50. ModTime time.Time
  51. }