Documentation
¶
Overview ¶
Package sink delivers a rendered relay to a configured target — an apprise notification (through the swappable Notifier seam) or a generic HTTP request. Each sink applies a bounded retry policy (transport/timeout/5xx, exponential backoff with full jitter, capped by the request deadline; never a 4xx). Fan-out across a route's target list is the caller's job.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message struct {
Title string
Body string
Params map[string]string // apprise provider params (rendered)
Headers map[string]string // http extra headers (rendered route headers)
ContentType string // http body content-type
}
Message is the rendered content relayed to a target. A given sink uses the fields relevant to its kind: apprise uses Title/Body/Params; http uses Body/Headers/ContentType.
type Notifier ¶
type Notifier interface {
Send(ctx context.Context, targetURL, body, title string, params map[string]string) error
}
Notifier is the notification backend seam: apprise-go today, a Go-native or sidecar backend tomorrow, as a one-file swap. The route's params are merged into the target URL's query by the implementation.
func DefaultNotifier ¶
func DefaultNotifier() Notifier
DefaultNotifier returns the apprise-go-backed Notifier.
type Options ¶
type Options struct {
Notifier Notifier // apprise backend; DefaultNotifier() when nil
DefaultRetry RetryPolicy
DefaultTimeout time.Duration // http per-target timeout when the target sets none
}
Options carry the cross-cutting defaults and the injected Notifier.
type RetryPolicy ¶
type RetryPolicy struct {
Attempts int // total tries (>= 1)
Backoff time.Duration // base for exponential backoff + jitter
}
RetryPolicy bounds a target's send attempts.