app_event_webhook.go 790 B

123456789101112131415161718192021222324
  1. package test
  2. import (
  3. "context"
  4. "errors"
  5. "github.com/porter-dev/porter/internal/models"
  6. "github.com/porter-dev/porter/internal/repository"
  7. )
  8. // AppEventWebhookRepository is a test repository for AppEventWebhooks
  9. type AppEventWebhookRepository struct {
  10. canQuery bool
  11. }
  12. // NewAppEventWebhookRepository returns a new AppEventWebhookRepository
  13. func NewAppEventWebhookRepository(canQuery bool, failingMethods ...string) repository.AppEventWebhookRepository {
  14. return &AppEventWebhookRepository{canQuery: false}
  15. }
  16. // Insert is a placeholder - actual implementation of this repository in CCP
  17. func (repo *AppEventWebhookRepository) Insert(context.Context, models.AppEventWebhooks) (models.AppEventWebhooks, error) {
  18. return models.AppEventWebhooks{}, errors.New("cannot read database")
  19. }