webhook

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package webhook posts usage events as JSON to an HTTP endpoint. Delivery is asynchronous so the request path never blocks on the sink.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sink

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

Sink POSTs each usage event to URL.

func New

func New(url string, timeout time.Duration) *Sink

New builds a webhook sink. timeout <= 0 uses a 3s default.

func (*Sink) OnUsage

func (s *Sink) OnUsage(ctx context.Context, ev hooks.UsageEvent)

OnUsage queues a non-blocking POST. Failures are logged; they never affect the client response (the usage event was already recorded on the request path).

Jump to

Keyboard shortcuts

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