webhook

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: 0BSD Imports: 14 Imported by: 0

Documentation

Overview

Package webhook delivers events to registered endpoints: HMAC-signed JSON POSTs with bounded retries, exponential backoff, and dead-lettering.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateURL

func ValidateURL(raw string, allowLocal bool) error

ValidateURL rejects URLs a webhook must not target: non-HTTP schemes and, unless allowLocal, anything resolving to loopback, private, or link-local addresses (SSRF).

Types

type Deliverer

type Deliverer struct {
	St          *store.Store
	AllowLocal  bool
	RetryBase   time.Duration // first retry delay; doubles per attempt
	MaxAttempts int
	// contains filtered or unexported fields
}

func New

func New(st *store.Store, allowLocal bool, retryBase time.Duration) *Deliverer

New builds a deliverer whose dialer re-checks resolved addresses at connect time, so a DNS answer that changes after ValidateURL still cannot reach private space.

func (*Deliverer) Run

func (d *Deliverer) Run(ctx context.Context)

Run polls for due deliveries until ctx is done.

Source Files

  • webhook.go

Jump to

Keyboard shortcuts

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