Versions in this module Expand all Collapse all v0 v0.1.0 Nov 10, 2026 Changes in this version + const SuppressionInteractionDisabled + const SuppressionStaleRevision + var ErrConflict = errors.New("idempotency_conflict") + var ErrInput = errors.New("invalid_input") + var ErrNotFound = errors.New("not_found") + var ErrUnauthenticated = errors.New("unauthenticated") + var ErrUnavailable = errors.New("unavailable") + func OpenAPI() []byte + type Config struct + AggregationWindow time.Duration + CleanupBatch int + ResolveTimeout time.Duration + Retention time.Duration + type Consumer interface + Consume func(context.Context, Event) (Result, error) + type Cursor struct + CreatedAt time.Time + ID string + type Event struct + EventType string + ID string + Recipients []string + Revision int64 + Source string + Subject string + Target Target + TitleKey string + TitleParams map[string]string + Type string + type Notification struct + Count int64 + CreatedAt time.Time + ID string + ReadAt *time.Time + SourceModule string + Target Target + TargetStatus string + TitleKey string + TitleParams map[string]string + Type string + type Page struct + Items []Notification + NextCursor string + type Preferences struct + InteractionEnabled bool + type RecipientResult struct + ID string + Recipient string + SuppressionReason string + type Repository interface + Cleanup func(context.Context, time.Time, int) (int64, error) + Consume func(context.Context, Event, string, time.Time, time.Duration) (Result, error) + List func(context.Context, string, Cursor, int) ([]Notification, error) + MarkAllRead func(context.Context, string, time.Time) error + MarkRead func(context.Context, string, string, time.Time) error + Preferences func(context.Context, string, *bool) (Preferences, error) + Unread func(context.Context, string) (int64, error) + type Resolver interface + Resolve func(context.Context, string, string, Target) (string, error) + type Result struct + Ignored bool + Recipients []RecipientResult + type Service struct + func New(repo Repository, resolver Resolver, config Config, now func() time.Time) (*Service, error) + func (s *Service) Cleanup(ctx context.Context) (int64, error) + func (s *Service) Consume(ctx context.Context, d Event) (Result, error) + func (s *Service) List(ctx context.Context, owner, after string, limit int) (Page, error) + func (s *Service) MarkAllRead(ctx context.Context, owner string) error + func (s *Service) MarkRead(ctx context.Context, owner, id string) error + func (s *Service) Preferences(ctx context.Context, owner string, enabled *bool) (Preferences, error) + func (s *Service) Unread(ctx context.Context, owner string) (int64, error) + type Target struct + ID string + Kind string