webhooks

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Events = []Event{
	{"reception", "message.reception"},
	{"delivered", "message.delivered"},
	{"transient_error", "message.transient_error"},
	{"failed", "message.failed"},
	{"bounced", "message.bounced"},
	{"suppressed", "message.suppressed"},
	{"opened", "message.opened"},
	{"clicked", "message.clicked"},
	{"suppression_created", "suppression.created"},
	{"dns_error", "domain.dns_error"},
}

Events lists every webhook event type.

Functions

func EventNames added in v0.3.0

func EventNames() []string

EventNames returns the Name of every event.

func EventTypes added in v0.3.0

func EventTypes(events []Event) []string

EventTypes returns the Type of each event.

func EventValues added in v0.3.0

func EventValues() []string

EventValues returns the values --events takes: the Name of each event, then its Type.

func GenerateMsgID

func GenerateMsgID() string

func GenerateWebhookSecret

func GenerateWebhookSecret() (string, error)

GenerateWebhookSecret returns a new secret for signing webhooks: "aha-whsec-" and 64 random letters and digits.

Types

type Event added in v0.3.0

type Event struct {
	Name string
	Type string
}

Event is a webhook event type. A webhook's settings name it by Name, as the API's on_<name> fields do; event payloads, the trigger endpoint and the listen filter name it by Type.

func FindEvent added in v0.3.0

func FindEvent(value string) (Event, bool)

FindEvent returns the event value names by its Name or its Type, in any case.

func ParseEvents added in v0.3.0

func ParseEvents(values []string) ([]Event, error)

ParseEvents returns the event each value names, by its Name or its Type in any case, in the order given. Values that name no event, which the error names before it lists the events, and a value that names an event an earlier value named, are validation errors of the --events flag.

type Signer

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

func NewSigner

func NewSigner(secret string) *Signer

func (*Signer) Sign

func (s *Signer) Sign(msgID string, timestamp time.Time, payload []byte) (string, error)

Jump to

Keyboard shortcuts

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