Documentation
¶
Overview ¶
Package webhooks delivers the outbox: every process claims due deliveries from the store, sends them the way WAHA does (headers, HMAC, retries) and records the outcome. Unlike WAHA, which fires and forgets, a delivery survives a restart.
Index ¶
Constants ¶
const ( DefaultDelaySeconds = 2 DefaultAttempts = 15 )
WAHA's retry defaults.
Variables ¶
This section is empty.
Functions ¶
func Backoff ¶
Backoff is the wait before retry number n (1-based), as axios-retry computes it for WAHA: constant, linear (n times the delay) or exponential (2^n times the delay plus up to 20% jitter), never less than Retry-After.
Types ¶
type Worker ¶
type Worker struct {
Store store.Store
Worker string
Timeout time.Duration
Client *http.Client
Log *slog.Logger
Now func() time.Time
// Poll is how often an idle worker looks for due deliveries.
Poll time.Duration
// Concurrency bounds the deliveries in flight; PerURL bounds those to
// one URL.
Concurrency, PerURL int
}
Worker delivers webhooks until its context ends.