templates.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package models
  2. // IndexYAML represents a chart repo's index.yaml
  3. type IndexYAML struct {
  4. APIVersion string `yaml:"apiVersion"`
  5. Generated string `yaml:"generated"`
  6. Entries map[interface{}]ChartYAML `yaml:"entries"`
  7. }
  8. // ChartYAML represents the data for chart in index.yaml
  9. type ChartYAML []struct {
  10. APIVersion string `yaml:"apiVersion"`
  11. AppVersion string `yaml:"appVersion"`
  12. Created string `yaml:"created"`
  13. Description string `yaml:"description"`
  14. Digest string `yaml:"digest"`
  15. Icon string `yaml:"icon"`
  16. Name string `yaml:"name"`
  17. Type string `yaml:"type"`
  18. Urls []string `yaml:"urls"`
  19. Version string `yaml:"version"`
  20. }
  21. // PorterChart represents a bundled Porter template
  22. type PorterChart struct {
  23. Name string `json:"name"`
  24. Description string `json:"description"`
  25. Icon string `json:"icon"`
  26. Form FormYAML `json:"form"`
  27. Markdown string `json:"markdown"`
  28. }
  29. // FormYAML represents a chart's values.yaml form abstraction
  30. type FormYAML struct {
  31. Name string `yaml:"name" json:"name"`
  32. Icon string `yaml:"icon" json:"icon"`
  33. Description string `yaml:"description" json:"description"`
  34. Tags []string `yaml:"tags" json:"tags"`
  35. Tabs []struct {
  36. Name string `yaml:"name" json:"name"`
  37. Label string `yaml:"label" json:"label"`
  38. Sections []struct {
  39. Name string `yaml:"name" json:"name"`
  40. ShowIf string `yaml:"show_if" json:"show_if"`
  41. Contents []struct {
  42. Type string `yaml:"type" json:"type"`
  43. Label string `yaml:"label" json:"label"`
  44. Name string `yaml:"name,omitempty" json:"name,omitempty"`
  45. Variable string `yaml:"variable,omitempty" json:"variable,omitempty"`
  46. Settings struct {
  47. Default interface{} `yaml:"default,omitempty" json:"default,omitempty"`
  48. Unit interface{} `yaml:"unit,omitempty" json:"unit,omitempty"`
  49. } `yaml:"settings,omitempty" json:"settings,omitempty"`
  50. } `yaml:"contents" json:"contents,omitempty"`
  51. } `yaml:"sections" json:"sections,omitempty"`
  52. } `yaml:"tabs" json:"tabs,omitempty"`
  53. }