2
0

github_webhook.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package test
  2. import (
  3. "context"
  4. "errors"
  5. "github.com/google/uuid"
  6. "github.com/porter-dev/porter/internal/models"
  7. "github.com/porter-dev/porter/internal/repository"
  8. )
  9. // GithubWebhookRepository is a test repository that implements repository.GithubWebhookRepository
  10. type GithubWebhookRepository struct {
  11. canQuery bool
  12. }
  13. // NewGithubWebhookRepository returns the test GithubWebhookRepository
  14. func NewGithubWebhookRepository() repository.GithubWebhookRepository {
  15. return &GithubWebhookRepository{canQuery: false}
  16. }
  17. // Insert inserts a new GithubWebhook into the db
  18. func (repo *GithubWebhookRepository) Insert(ctx context.Context, webhook *models.GithubWebhook) (*models.GithubWebhook, error) {
  19. return nil, errors.New("cannot write database")
  20. }
  21. // GetByClusterAndAppID finds a GithubWebhook by clusterID and appID
  22. func (repo *GithubWebhookRepository) GetByClusterAndAppID(ctx context.Context, clusterID, appID uint) (*models.GithubWebhook, error) {
  23. return nil, errors.New("cannot read database")
  24. }
  25. // Get finds a GithubWebhook by id
  26. func (repo *GithubWebhookRepository) Get(ctx context.Context, id uuid.UUID) (*models.GithubWebhook, error) {
  27. return nil, errors.New("cannot read database")
  28. }