webhook

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SignatureHeader = "X-Certmatic-Signature"

Variables

This section is empty.

Functions

func Sign

func Sign(signingKey []byte, timestamp time.Time, body []byte) string

Sign computes a webhook signature header value. Format: ts_s=<unix_timestamp>,v1=<hex_hmac_sha256> The signed payload is "<timestamp>.<body>".

Types

type MemoryDispatcher

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

MemoryDispatcher is an in-memory webhook event dispatcher. Events are queued in a buffered channel and delivered by a background goroutine.

func NewMemoryDispatcher

func NewMemoryDispatcher(endpoints []webhook.Endpoint, logger *zap.Logger) *MemoryDispatcher

NewMemoryDispatcher creates a dispatcher that delivers events to the given endpoints. A background goroutine processes the queue until Destruct is called.

func (*MemoryDispatcher) Destruct

func (d *MemoryDispatcher) Destruct() error

Destruct stops the background delivery goroutine.

func (*MemoryDispatcher) Dispatch

func (d *MemoryDispatcher) Dispatch(event webhook.Event)

Dispatch enqueues an event for asynchronous delivery. If the queue is full the event is dropped and a warning is logged.

Jump to

Keyboard shortcuts

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