Documentation
¶
Index ¶
- type EventRepository
- func (r *EventRepository) Create(ctx context.Context, event *models.Event) error
- func (r *EventRepository) CreateEvent(ctx context.Context, event *models.Event) error
- func (r *EventRepository) CreateOccurrence(ctx context.Context, occurrence *models.Occurrence) error
- func (r *EventRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (r *EventRepository) DeleteOldEvents(ctx context.Context, cutoff time.Time) error
- func (r *EventRepository) DeleteOldOccurrences(ctx context.Context, cutoff time.Time) error
- func (r *EventRepository) GetByID(ctx context.Context, id uuid.UUID) (*models.Event, error)
- func (r *EventRepository) GetEvent(ctx context.Context, id string) (*models.Event, error)
- func (r *EventRepository) GetOccurrenceByID(ctx context.Context, id int) (*models.Occurrence, error)
- func (r *EventRepository) List(ctx context.Context) ([]models.Event, error)
- func (r *EventRepository) ListActive(ctx context.Context) ([]*models.Event, error)
- func (r *EventRepository) ListByTags(ctx context.Context, tags []string) ([]*models.Event, error)
- func (r *EventRepository) ListEvents(ctx context.Context, filter models.EventFilter) ([]*models.Event, error)
- func (r *EventRepository) RemoveEventOccurrencesFromRedis(ctx context.Context, eventID uuid.UUID) error
- func (r *EventRepository) Update(ctx context.Context, event *models.Event) error
- type OccurrenceRepository
- func (r *OccurrenceRepository) CountCompletedByEventID(ctx context.Context, eventID uuid.UUID) (int, error)
- func (r *OccurrenceRepository) Create(ctx context.Context, occurrence *models.Occurrence) error
- func (r *OccurrenceRepository) ExistsAtTime(ctx context.Context, eventID uuid.UUID, scheduledAt time.Time) (bool, error)
- func (r *OccurrenceRepository) GetByID(ctx context.Context, id int) (*models.Occurrence, error)
- func (r *OccurrenceRepository) GetLatestByOccurrenceID(ctx context.Context, occurrenceID uuid.UUID) (*models.Occurrence, error)
- func (r *OccurrenceRepository) ListByEventID(ctx context.Context, eventID uuid.UUID) ([]models.Occurrence, error)
- func (r *OccurrenceRepository) ListByTags(ctx context.Context, filter models.OccurrenceFilter) ([]models.Occurrence, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventRepository ¶
type EventRepository struct {
// contains filtered or unexported fields
}
func NewEventRepository ¶
func (*EventRepository) CreateEvent ¶
func (*EventRepository) CreateOccurrence ¶
func (r *EventRepository) CreateOccurrence(ctx context.Context, occurrence *models.Occurrence) error
func (*EventRepository) DeleteOldEvents ¶
DeleteOldEvents deletes events that are older than the specified cutoff time
func (*EventRepository) DeleteOldOccurrences ¶
DeleteOldOccurrences deletes occurrences that are older than the specified cutoff time
func (*EventRepository) GetOccurrenceByID ¶
func (r *EventRepository) GetOccurrenceByID(ctx context.Context, id int) (*models.Occurrence, error)
func (*EventRepository) ListActive ¶
func (*EventRepository) ListByTags ¶
func (*EventRepository) ListEvents ¶
func (r *EventRepository) ListEvents(ctx context.Context, filter models.EventFilter) ([]*models.Event, error)
func (*EventRepository) RemoveEventOccurrencesFromRedis ¶
func (r *EventRepository) RemoveEventOccurrencesFromRedis(ctx context.Context, eventID uuid.UUID) error
RemoveEventOccurrencesFromRedis removes all scheduled occurrences for an event from Redis
type OccurrenceRepository ¶
type OccurrenceRepository struct {
// contains filtered or unexported fields
}
func NewOccurrenceRepository ¶
func NewOccurrenceRepository(db *sqlx.DB, logger *zap.Logger) *OccurrenceRepository
func (*OccurrenceRepository) CountCompletedByEventID ¶
func (r *OccurrenceRepository) CountCompletedByEventID(ctx context.Context, eventID uuid.UUID) (int, error)
CountCompletedByEventID returns the number of completed occurrences for a given event ID
func (*OccurrenceRepository) Create ¶
func (r *OccurrenceRepository) Create(ctx context.Context, occurrence *models.Occurrence) error
func (*OccurrenceRepository) ExistsAtTime ¶
func (r *OccurrenceRepository) ExistsAtTime(ctx context.Context, eventID uuid.UUID, scheduledAt time.Time) (bool, error)
ExistsAtTime checks if an occurrence exists for a given event at a specific time
func (*OccurrenceRepository) GetByID ¶
func (r *OccurrenceRepository) GetByID(ctx context.Context, id int) (*models.Occurrence, error)
func (*OccurrenceRepository) GetLatestByOccurrenceID ¶
func (r *OccurrenceRepository) GetLatestByOccurrenceID(ctx context.Context, occurrenceID uuid.UUID) (*models.Occurrence, error)
GetLatestByOccurrenceID fetches the latest occurrence row for a given OccurrenceID
func (*OccurrenceRepository) ListByEventID ¶
func (r *OccurrenceRepository) ListByEventID(ctx context.Context, eventID uuid.UUID) ([]models.Occurrence, error)
func (*OccurrenceRepository) ListByTags ¶
func (r *OccurrenceRepository) ListByTags(ctx context.Context, filter models.OccurrenceFilter) ([]models.Occurrence, int, error)
Click to show internal directories.
Click to hide internal directories.