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.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. Hostname string
  47. Cert string
  48. Chain string
  49. FullChain string
  50. PrivateKey string
  51. ModTime time.Time
  52. }