webhook

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

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

Emitter sends events via HTTP POST with optional HMAC-SHA256 signature.

func New

func New(url string, opts ...Option) *Emitter

New creates a webhook Emitter with the given URL.

func (*Emitter) Emit

func (e *Emitter) Emit(ctx context.Context, ev *event.Event) error

Emit sends the event as a JSON POST. If a secret is configured, adds HMAC-SHA256 signature.

type Option

type Option func(*Emitter)

Option configures the webhook Emitter.

func WithSecret

func WithSecret(secret string) Option

WithSecret sets the HMAC-SHA256 signing secret.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the HTTP client timeout.

Jump to

Keyboard shortcuts

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