registry.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package types
  2. type Registry struct {
  3. ID uint `json:"id"`
  4. // The project that this integration belongs to
  5. ProjectID uint `json:"project_id"`
  6. // Name of the registry
  7. Name string `json:"name"`
  8. // URL of the registry
  9. URL string `json:"url"`
  10. // The integration service for this registry
  11. Service RegistryService `json:"service"`
  12. // The infra id, if registry was provisioned with Porter
  13. InfraID uint `json:"infra_id"`
  14. }
  15. type RegistryService string
  16. const (
  17. GCR RegistryService = "gcr"
  18. ECR RegistryService = "ecr"
  19. DOCR RegistryService = "docr"
  20. DockerHub RegistryService = "dockerhub"
  21. )
  22. type RegistryListResponse []Registry
  23. type CreateRegistryRequest struct {
  24. URL string `json:"url"`
  25. Name string `json:"name" form:"required"`
  26. GCPIntegrationID uint `json:"gcp_integration_id"`
  27. AWSIntegrationID uint `json:"aws_integration_id"`
  28. DOIntegrationID uint `json:"do_integration_id"`
  29. BasicIntegrationID uint `json:"basic_integration_id"`
  30. }
  31. type CreateRegistryRepositoryRequest struct {
  32. ImageRepoURI string `json:"image_repo_uri" form:"required"`
  33. }
  34. // UpdateRegistryRequest represents the accepted values for updating a
  35. // registry (only name for now)
  36. type UpdateRegistryRequest struct {
  37. Name string `json:"name" form:"required"`
  38. }