integrations.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package repository
  2. import (
  3. ints "github.com/porter-dev/porter/internal/models/integrations"
  4. )
  5. // KubeIntegrationRepository represents the set of queries on the OIDC auth
  6. // mechanism
  7. type KubeIntegrationRepository interface {
  8. CreateKubeIntegration(am *ints.KubeIntegration) (*ints.KubeIntegration, error)
  9. ReadKubeIntegration(id uint) (*ints.KubeIntegration, error)
  10. ListKubeIntegrationsByProjectID(projectID uint) ([]*ints.KubeIntegration, error)
  11. }
  12. // BasicIntegrationRepository represents the set of queries on the "basic" auth
  13. // mechanism
  14. type BasicIntegrationRepository interface {
  15. CreateBasicIntegration(am *ints.BasicIntegration) (*ints.BasicIntegration, error)
  16. ReadBasicIntegration(id uint) (*ints.BasicIntegration, error)
  17. ListBasicIntegrationsByProjectID(projectID uint) ([]*ints.BasicIntegration, error)
  18. }
  19. // OIDCIntegrationRepository represents the set of queries on the OIDC auth
  20. // mechanism
  21. type OIDCIntegrationRepository interface {
  22. CreateOIDCIntegration(am *ints.OIDCIntegration) (*ints.OIDCIntegration, error)
  23. ReadOIDCIntegration(id uint) (*ints.OIDCIntegration, error)
  24. ListOIDCIntegrationsByProjectID(projectID uint) ([]*ints.OIDCIntegration, error)
  25. }
  26. // OAuthIntegrationRepository represents the set of queries on the oauth
  27. // mechanism
  28. type OAuthIntegrationRepository interface {
  29. CreateOAuthIntegration(am *ints.OAuthIntegration) (*ints.OAuthIntegration, error)
  30. ReadOAuthIntegration(id uint) (*ints.OAuthIntegration, error)
  31. ListOAuthIntegrationsByProjectID(projectID uint) ([]*ints.OAuthIntegration, error)
  32. }
  33. // AWSIntegrationRepository represents the set of queries on the AWS auth
  34. // mechanism
  35. type AWSIntegrationRepository interface {
  36. CreateAWSIntegration(am *ints.AWSIntegration) (*ints.AWSIntegration, error)
  37. ReadAWSIntegration(id uint) (*ints.AWSIntegration, error)
  38. ListAWSIntegrationsByProjectID(projectID uint) ([]*ints.AWSIntegration, error)
  39. }
  40. // GCPIntegrationRepository represents the set of queries on the GCP auth
  41. // mechanism
  42. type GCPIntegrationRepository interface {
  43. CreateGCPIntegration(am *ints.GCPIntegration) (*ints.GCPIntegration, error)
  44. ReadGCPIntegration(id uint) (*ints.GCPIntegration, error)
  45. ListGCPIntegrationsByProjectID(projectID uint) ([]*ints.GCPIntegration, error)
  46. }