repository

package
v0.0.0-...-ce3407c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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 NewEventRepository(db *sqlx.DB, logger *zap.Logger, redis *redis.Client, prefix string) *EventRepository

func (*EventRepository) Create

func (r *EventRepository) Create(ctx context.Context, event *models.Event) error

func (*EventRepository) CreateEvent

func (r *EventRepository) CreateEvent(ctx context.Context, event *models.Event) error

func (*EventRepository) CreateOccurrence

func (r *EventRepository) CreateOccurrence(ctx context.Context, occurrence *models.Occurrence) error

func (*EventRepository) Delete

func (r *EventRepository) Delete(ctx context.Context, id uuid.UUID) error

func (*EventRepository) DeleteOldEvents

func (r *EventRepository) DeleteOldEvents(ctx context.Context, cutoff time.Time) error

DeleteOldEvents deletes events that are older than the specified cutoff time

func (*EventRepository) DeleteOldOccurrences

func (r *EventRepository) DeleteOldOccurrences(ctx context.Context, cutoff time.Time) error

DeleteOldOccurrences deletes occurrences that are older than the specified cutoff time

func (*EventRepository) GetByID

func (r *EventRepository) GetByID(ctx context.Context, id uuid.UUID) (*models.Event, error)

func (*EventRepository) GetEvent

func (r *EventRepository) GetEvent(ctx context.Context, id string) (*models.Event, error)

func (*EventRepository) GetOccurrenceByID

func (r *EventRepository) GetOccurrenceByID(ctx context.Context, id int) (*models.Occurrence, error)

func (*EventRepository) List

func (r *EventRepository) List(ctx context.Context) ([]models.Event, error)

func (*EventRepository) ListActive

func (r *EventRepository) ListActive(ctx context.Context) ([]*models.Event, error)

func (*EventRepository) ListByTags

func (r *EventRepository) ListByTags(ctx context.Context, tags []string) ([]*models.Event, error)

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

func (*EventRepository) Update

func (r *EventRepository) Update(ctx context.Context, event *models.Event) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL