Documentation
¶
Index ¶
Constants ¶
const ConsumerGroup = "notifier"
ConsumerGroup is the Kafka consumer group the notifier joins. All notifier replicas share it, so the broker splits partitions among them.
const ServiceName = "notifier service"
Variables ¶
var (
NotificationsEndPnt = "/v1/notifications"
)
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service consumes order events and (eventually) dispatches notifications. It is a background consumer with health/status HTTP endpoints and no domain REST API — the mirror image of the orders relay: relay drains outbox → broker; notifier consumes broker → processes → marks delivered.
func NewService ¶
func NewService(authn auth.Authenticator, store store, consumer messaging.Consumer, sink Sink, ) *Service
NewService constructs the notifier. The listening port is the httpserver's concern, not the service's.
func (*Service) Notifications ¶
func (h *Service) Notifications() httprouter.Handle
Notifications godoc @Summary List notifications @Description List the notifications derived from the outbox, newest events first. @Tags notifications @Produce json @Param undelivered query bool false "Only return notifications not yet delivered" @Success 200 {array} model.Notification @Failure 401 {object} errors.JSONError @Failure 500 {object} errors.JSONError @Security XAuthPassword @Router /v1/notifications [get]
func (*Service) RegisterHandlers ¶
func (h *Service) RegisterHandlers() *httprouter.Router
RegisterHandlers exposes liveness/readiness and the notifications view. The notifier has no write API; its work happens in the consume loop (see Start). The probe mechanism is shared via httpserver; the notifier supplies its checks.