integrations.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. // OIDCIntegrationRepository represents the set of queries on the OIDC auth
  13. // mechanism
  14. type OIDCIntegrationRepository interface {
  15. CreateOIDCIntegration(am *ints.OIDCIntegration) (*ints.OIDCIntegration, error)
  16. ReadOIDCIntegration(id uint) (*ints.OIDCIntegration, error)
  17. ListOIDCIntegrationsByProjectID(projectID uint) ([]*ints.OIDCIntegration, error)
  18. }
  19. // OAuthIntegrationRepository represents the set of queries on the oauth
  20. // mechanism
  21. type OAuthIntegrationRepository interface {
  22. CreateOAuthIntegration(am *ints.OAuthIntegration) (*ints.OAuthIntegration, error)
  23. ReadOAuthIntegration(id uint) (*ints.OAuthIntegration, error)
  24. ListOAuthIntegrationsByProjectID(projectID uint) ([]*ints.OAuthIntegration, error)
  25. }
  26. // AWSIntegrationRepository represents the set of queries on the AWS auth
  27. // mechanism
  28. type AWSIntegrationRepository interface {
  29. CreateAWSIntegration(am *ints.AWSIntegration) (*ints.AWSIntegration, error)
  30. ReadAWSIntegration(id uint) (*ints.AWSIntegration, error)
  31. ListAWSIntegrationsByProjectID(projectID uint) ([]*ints.AWSIntegration, error)
  32. }
  33. // GCPIntegrationRepository represents the set of queries on the GCP auth
  34. // mechanism
  35. type GCPIntegrationRepository interface {
  36. CreateGCPIntegration(am *ints.GCPIntegration) (*ints.GCPIntegration, error)
  37. ReadGCPIntegration(id uint) (*ints.GCPIntegration, error)
  38. ListGCPIntegrationsByProjectID(projectID uint) ([]*ints.GCPIntegration, error)
  39. }