2
0

template.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package types
  2. import (
  3. "github.com/porter-dev/porter/internal/helm/upgrade"
  4. "helm.sh/helm/v3/pkg/chart"
  5. )
  6. const (
  7. URLParamTemplateName URLParam = "name"
  8. URLParamTemplateVersion URLParam = "version"
  9. )
  10. type TemplateGetBaseRequest struct {
  11. RepoURL string `schema:"repo_url"`
  12. }
  13. type ListTemplatesRequest struct {
  14. TemplateGetBaseRequest
  15. }
  16. type PorterTemplateSimple struct {
  17. Name string `json:"name"`
  18. Versions []string `json:"versions"`
  19. Description string `json:"description"`
  20. Icon string `json:"icon"`
  21. }
  22. // ListTemplatesResponse is how a chart gets displayed when listed
  23. type ListTemplatesResponse []PorterTemplateSimple
  24. type GetTemplateRequest struct {
  25. TemplateGetBaseRequest
  26. }
  27. // GetTemplateResponse is a chart with detailed information and a form for reading
  28. type GetTemplateResponse struct {
  29. Markdown string `json:"markdown"`
  30. Metadata *chart.Metadata `json:"metadata"`
  31. Values map[string]interface{} `json:"values"`
  32. Form *FormYAML `json:"form"`
  33. }
  34. type GetTemplateUpgradeNotesRequest struct {
  35. TemplateGetBaseRequest
  36. PrevVersion string `schema:"prev_version"`
  37. }
  38. type GetTemplateUpgradeNotesResponse upgrade.UpgradeFile