webhook

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package webhook delivers HMAC-signed POSTs to a configured receiver URL on every newly captured message. Best-effort with simple retry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTP *http.Client
}

Client is stateless. One HTTP client is shared across deliveries so keep-alive connections amortize.

func NewClient

func NewClient() *Client

func (*Client) Deliver

func (c *Client) Deliver(ctx context.Context, url, secret string, payload []byte) error

Deliver POSTs `payload` to `url`, signing with `secret` if non-empty. Returns nil on 2xx, *PermanentError on 4xx (don't retry), or a generic error on 5xx / network blips.

func (*Client) SendTestPing

func (c *Client) SendTestPing(ctx context.Context, url, secret string) error

SendTestPing fires a synthetic event to the URL; used by the dialog's "Send test" button.

type PermanentError

type PermanentError struct{ Msg string }

PermanentError signals "don't retry".

func (*PermanentError) Error

func (e *PermanentError) Error() string

Jump to

Keyboard shortcuts

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