Documentation
¶
Index ¶
- func NewDelivery(logger *slog.Logger, historyStore history.Recorder, ...) types.Delivery
- type Dispatcher
- type Manager
- func (m *Manager) Enqueue(n types.Notification) string
- func (m *Manager) Receivers() []*types.Receiver
- func (m *Manager) Register(heartbeatID string, receivers map[string]*types.Receiver)
- func (m *Manager) RegisterHeartbeat(heartbeatID string, meta types.HeartbeatMeta)
- func (m *Manager) ResetRegistries()
- func (m *Manager) Start(ctx context.Context)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher dequeues notifications and delivers them.
func NewDispatcher ¶
func NewDispatcher( store *Store, mailbox <-chan string, delivery types.Delivery, registry map[string]map[string]*types.Receiver, heartbeats map[string]types.HeartbeatMeta, logger *slog.Logger, ) *Dispatcher
NewDispatcher constructs a Dispatcher with the provided mailbox.
func (*Dispatcher) Start ¶
func (d *Dispatcher) Start(ctx context.Context)
Start begins processing notifications until ctx is canceled.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager owns notification delivery infrastructure.
func NewManager ¶
func NewManager( logger *slog.Logger, historyStore history.Recorder, metricsReg *metrics.Registry, ) *Manager
NewManager constructs a notification manager with a buffered mailbox.
func (*Manager) Enqueue ¶
func (m *Manager) Enqueue(n types.Notification) string
Enqueue stores the notification and returns its id.
func (*Manager) Receivers ¶
Receivers returns the unique receivers registered across all heartbeats.
func (*Manager) RegisterHeartbeat ¶
func (m *Manager) RegisterHeartbeat(heartbeatID string, meta types.HeartbeatMeta)
RegisterHeartbeat stores metadata for a heartbeat id.
func (*Manager) ResetRegistries ¶
func (m *Manager) ResetRegistries()
ResetRegistries clears the receiver and heartbeat registries.
Click to show internal directories.
Click to hide internal directories.