s3-orchestrator

notify

import "github.com/afreidah/s3-orchestrator/internal/notify"

Package notify drains the notification_outbox table and delivers each pending event to its configured webhook target with retries and exponential backoff under an advisory lock for multi-instance safety.

Index

type Notifier

Notifier delivers webhook notifications from a durable outbox queue. Implements lifecycle.Runner via the Run method.

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

func NewNotifier

func NewNotifier(cfg *config.NotificationConfig, store OutboxStore) *Notifier

NewNotifier creates a notifier backed by the given outbox store. Sets the package-level event.Emit hook so all packages can emit notifications via the same mechanism.

func (*Notifier) Run

func (n *Notifier) Run(ctx context.Context) error

Run implements lifecycle.Runner. Drains the notification outbox under an advisory lock, delivering pending events via HTTP POST.

type OutboxStore

OutboxStore defines the persistence methods the notifier needs for durable event delivery. Composed of the durable outbox row operations plus the advisory-lock helper used to serialize the drain loop across replicas. Both core.NotificationOutbox and core.AdvisoryLocker are satisfied by the engine concrete *Store.

type OutboxStore interface {
    core.NotificationOutbox
    core.AdvisoryLocker
}

Generated by gomarkdoc