notifier

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package notifier is the webhook sink of the Event stream: the one outbound Notifier Ripen ships with. It is off by default, filtered, and deliberately unreliable in one direction only — delivery may be dropped, never a Transaction.

Three rules shape it. Delivery is at-most-once and fail-open: a run never waits for a webhook and never fails because of one. Paging is on state *changes*, so a stack that has been broken for a week pages once, and pages again the moment it breaks after recovering. And the state database is the system of record: an Event can only report what is already written there.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Settings   config.WebhookSettings
	Heartbeat  time.Duration
	Store      *state.Store
	Stream     *event.Stream
	HTTPClient *http.Client
	Clock      func() time.Time
	QueueSize  int
	// Backoff is the pause between delivery attempts.
	Backoff time.Duration
}

Options configures a Webhook.

type Webhook

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

Webhook is the outbound Notifier.

func New

func New(options Options) (*Webhook, error)

New reads the destination, resets suppression if it changed, and starts the delivery worker.

func (*Webhook) Close

func (w *Webhook) Close() error

Close drains the queue and stops the worker.

func (*Webhook) Dropped

func (w *Webhook) Dropped() int

Dropped is how many Events this process could not queue.

func (*Webhook) Emit

func (w *Webhook) Emit(envelope event.Envelope)

Emit queues one Event for delivery. It never blocks: a full queue drops the Event and counts it, because a run must not wait on a webhook.

func (*Webhook) Test

func (w *Webhook) Test() error

Test sends a real notifier.test through the real delivery path, and reports what happened. Nothing about it is a special case except that it is never filtered or suppressed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL