l8notify
Multi-channel notification dispatch with throttling and escalation.
l8notify is a shared notification library, not a standalone service. Consumer projects import its Go packages and copy its l8ui components into their own web directories. It provides reusable packages for notification delivery, template rendering, throttling, and escalation scheduling.
l8notify never persists anything. The consumer project stores policies, rules, SMTP configs, webhook configs, and delivery logs in its own services. l8notify only provides the types and runtime behavior.
Sender interface implementationchannel.Dispatch() routes a rendered message to the appropriate sender based on the target's channel type. Email sends via SMTP. Webhooks sign with HMAC-SHA256 and retry with exponential backoff (1s, 2s, 4s). Slack posts to an incoming webhook URL. Custom channels iterate all registered senders.
template.Render(tmpl, vars) replaces {{key}} placeholders with values from a map. Unknown placeholders are left as-is. RenderWithDefault replaces remaining placeholders with a default value.
Thread-safe per-key cooldown and hourly rate limiter. Call IsThrottled() before dispatch, Record() after a successful send. Supports per-entity cooldown and per-policy hourly caps.
Schedules escalation chains for entities. Steps are sorted by order and fire after their configured delay via goroutine timers. Templates are rendered before calling the consumer's StepHandler. Active escalations can be cancelled when an entity is acknowledged or resolved.
All types are shared building blocks embedded in consumer-specific types. None are Prime Objects.
NotifyChannelDeliveryStatusNotifyTargetSmtpConfigWebhookConfigDeliveryResultEscalationStepl8notify ships reusable UI components that consumers copy into their web directory:
NotifyTarget arrays in policy formsGo: google.golang.org/protobuf only. No l8orm, l8services, l8bus, or other Layer 8 infrastructure dependencies. l8ui components require the l8ui shared library already present in the consumer project.