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.
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 ¶
WithRetryDelays overrides the default retry delays (useful for testing).