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

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