2
0

template.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. Tags []string `json:"tags,omitempty"`
  29. }
  30. // ListTemplatesResponse is how a chart gets displayed when listed
  31. // swagger:model ListTemplatesResponse
  32. type ListTemplatesResponse []PorterTemplateSimple
  33. type GetTemplateRequest struct {
  34. TemplateGetBaseRequest
  35. }
  36. // GetTemplateResponse is a chart with detailed information and a form for reading
  37. // swagger:model GetTemplateResponse
  38. type GetTemplateResponse struct {
  39. Markdown string `json:"markdown"`
  40. Metadata *chart.Metadata `json:"metadata"`
  41. Values map[string]interface{} `json:"values"`
  42. Form *FormYAML `json:"form"`
  43. RepoURL string `json:"repo_url,omitempty"`
  44. }
  45. type GetTemplateUpgradeNotesRequest struct {
  46. TemplateGetBaseRequest
  47. PrevVersion string `schema:"prev_version"`
  48. }
  49. // swagger:model GetTemplateUpgradeNotesResponse
  50. type GetTemplateUpgradeNotesResponse upgrade.UpgradeFile