webhook

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package webhook implements event-driven webhook dispatch. A Dispatcher subscribes to the event bus and delivers matching events to registered webhook endpoints as signed HTTP POST requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeliveryLogger

type DeliveryLogger interface {
	WebhookDeliveryInsert(ctx context.Context, d model.WebhookDelivery) (model.WebhookDelivery, error)
}

DeliveryLogger records webhook delivery attempts.

type Dispatcher

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

Dispatcher subscribes to an event bus and delivers matching events to webhook endpoints. Delivery is asynchronous and non-blocking.

func NewDispatcher

func NewDispatcher(bus *eventbus.EventBus, lister WebhookLister, logger DeliveryLogger, opts ...Option) *Dispatcher

NewDispatcher creates and starts a webhook dispatcher. Call Stop() to shut it down.

func (*Dispatcher) Stop

func (d *Dispatcher) Stop()

Stop shuts down the dispatcher.

type Option

type Option func(*Dispatcher)

NewDispatcher creates and starts a webhook dispatcher. Call Stop() to shut it down. Option configures a Dispatcher.

func WithRetryDelays

func WithRetryDelays(delays []time.Duration) Option

WithRetryDelays overrides the default retry delays (useful for testing).

type WebhookLister

type WebhookLister interface {
	ListWebhooks(ctx context.Context) ([]model.Webhook, error)
}

WebhookLister provides access to webhook registrations.

Jump to

Keyboard shortcuts

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