porter_app_event.go 1.8 KB

12345678910111213141516171819202122232425
  1. package repository
  2. import (
  3. "context"
  4. "github.com/google/uuid"
  5. "github.com/porter-dev/porter/internal/models"
  6. "github.com/porter-dev/porter/internal/repository/gorm/helpers"
  7. )
  8. // PorterAppEventRepository represents the set of queries on the PorterAppEvent model
  9. type PorterAppEventRepository interface {
  10. ListEventsByPorterAppID(ctx context.Context, porterAppID uint, opts ...helpers.QueryOption) ([]*models.PorterAppEvent, helpers.PaginatedResult, error)
  11. // ListEventsByPorterAppIDAndDeploymentTargetID returns a list of events for a given porter app id and deployment target id
  12. ListEventsByPorterAppIDAndDeploymentTargetID(ctx context.Context, porterAppID uint, deploymentTargetID uuid.UUID, opts ...helpers.QueryOption) ([]*models.PorterAppEvent, helpers.PaginatedResult, error)
  13. ListBuildDeployEventsByPorterAppIDAndDeploymentTargetID(ctx context.Context, porterAppID uint, deploymentTargetID uuid.UUID, opts ...helpers.QueryOption) ([]*models.PorterAppEvent, helpers.PaginatedResult, error)
  14. CreateEvent(ctx context.Context, appEvent *models.PorterAppEvent) error
  15. UpdateEvent(ctx context.Context, appEvent *models.PorterAppEvent) error
  16. ReadEvent(ctx context.Context, id uuid.UUID) (models.PorterAppEvent, error)
  17. ReadDeployEventByRevision(ctx context.Context, porterAppID uint, revision float64) (models.PorterAppEvent, error)
  18. // ReadDeployEventByAppRevisionID returns a deploy event for a given porter app id and app revision ID
  19. ReadDeployEventByAppRevisionID(ctx context.Context, porterAppID uint, appRevisionID string) (models.PorterAppEvent, error)
  20. ReadNotificationsByAppRevisionID(ctx context.Context, porterAppInstanceID uuid.UUID, appRevisionID string) ([]*models.PorterAppEvent, error)
  21. NotificationByID(ctx context.Context, notificationID string) (*models.PorterAppEvent, error)
  22. }