template.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package types
  2. import (
  3. "github.com/porter-dev/porter/internal/helm/upgrade"
  4. "github.com/stefanmcshane/helm/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. // The name of the template
  18. Name string `json:"name"`
  19. // The list of valid versions for the template
  20. Versions []string `json:"versions"`
  21. // A description for the template
  22. Description string `json:"description"`
  23. // An image URI for the icon
  24. Icon string `json:"icon"`
  25. // The repo URL for the template
  26. RepoURL string `json:"repo_url,omitempty"`
  27. }
  28. // ListTemplatesResponse is how a chart gets displayed when listed
  29. // swagger:model ListTemplatesResponse
  30. type ListTemplatesResponse []PorterTemplateSimple
  31. type GetTemplateRequest struct {
  32. TemplateGetBaseRequest
  33. }
  34. // GetTemplateResponse is a chart with detailed information and a form for reading
  35. // swagger:model GetTemplateResponse
  36. type GetTemplateResponse struct {
  37. Markdown string `json:"markdown"`
  38. Metadata *chart.Metadata `json:"metadata"`
  39. Values map[string]interface{} `json:"values"`
  40. Form *FormYAML `json:"form"`
  41. RepoURL string `json:"repo_url,omitempty"`
  42. }
  43. type GetTemplateUpgradeNotesRequest struct {
  44. TemplateGetBaseRequest
  45. PrevVersion string `schema:"prev_version"`
  46. }
  47. // swagger:model GetTemplateUpgradeNotesResponse
  48. type GetTemplateUpgradeNotesResponse upgrade.UpgradeFile