Documentation
¶
Index ¶
- type PollResult
- type Service
- type Store
- func (s *Store) Acknowledge(ctx context.Context, userID int64, traceIDs []string) error
- func (s *Store) GetUnacked(ctx context.Context, userID int64, cursor int64, limit int32) (*PollResult, error)
- func (s *Store) Subscribe(ctx context.Context, userID int64) (<-chan storage.Notification, func(), error)
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 (*Store) GetUnacked ¶
Click to show internal directories.
Click to hide internal directories.