notification

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PollResult

type PollResult struct {
	Notifications []storage.Notification `json:"notifications"`
}

type Service

type Service interface {
	// GetUnacked retrieves unacknowledged notifications using cursor-based pagination.
	// Pass 0 for the first page. cursor is the monotonic id.
	GetUnacked(ctx context.Context, userID int64, cursor int64, limit int32) (*PollResult, error)

	// Acknowledge marks the specified notifications as acknowledged by trace_id.
	Acknowledge(ctx context.Context, userID int64, traceIDs []string) error

	// Subscribe creates a subscription for live notifications.
	// Returns a channel that receives notifications and an unsubscribe function.
	Subscribe(ctx context.Context, userID int64) (<-chan storage.Notification, func(), error)
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(store storage.NotificationStore) *Store

func (*Store) Acknowledge

func (s *Store) Acknowledge(ctx context.Context, userID int64, traceIDs []string) error

func (*Store) GetUnacked

func (s *Store) GetUnacked(ctx context.Context, userID int64, cursor int64, limit int32) (*PollResult, error)

func (*Store) Subscribe

func (s *Store) Subscribe(ctx context.Context, userID int64) (<-chan storage.Notification, func(), error)

Jump to

Keyboard shortcuts

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