Documentation
¶
Index ¶
- type Repo
- func (r *Repo) Allowed(ctx context.Context, userID, typ string) (bool, error)
- func (r *Repo) Archive(ctx context.Context, userID, notificationID string) error
- func (r *Repo) DeleteAged(ctx context.Context, archivedTTL, readTTL time.Duration, batch int) (int64, error)
- func (r *Repo) EmailAllowed(ctx context.Context, userID, typ string) (bool, error)
- func (r *Repo) Insert(ctx context.Context, n app.NotifyInput, now time.Time) (bool, error)
- func (r *Repo) List(ctx context.Context, userID string) ([]app.Preference, error)
- func (r *Repo) ListInbox(ctx context.Context, userID, workspaceID string, limit int) ([]app.Notification, error)
- func (r *Repo) MarkAllRead(ctx context.Context, userID string) error
- func (r *Repo) MarkRead(ctx context.Context, userID, notificationID string) error
- func (r *Repo) UnreadCount(ctx context.Context, userID, workspaceID string) (int, error)
- func (r *Repo) Upsert(ctx context.Context, userID, typ string, email, inApp *bool) (app.Preference, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) DeleteAged ¶ added in v0.4.1
func (r *Repo) DeleteAged(ctx context.Context, archivedTTL, readTTL time.Duration, batch int) (int64, error)
DeleteAged prunes expired notifications in batches (F8-4): archived rows older than archivedTTL and read-but-not-archived rows older than readTTL. Unread rows are never deleted — they are still the user's pending signal. Returns the number of rows deleted (batch-capped; run to a zero return or on the next tick to drain a large backlog).
func (*Repo) EmailAllowed ¶
func (*Repo) UnreadCount ¶
Click to show internal directories.
Click to hide internal directories.