pidgeon

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 8 Imported by: ? 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

Overview

Package pidgeon is Pidgeon's webhook protocol: its calls are signed, with the endpoint's whsec_ secret, in Pidgeon-Signature, as t=<seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>">, which is too old after five minutes, say what happened in Pidgeon-Event, and the body's type, and their delivery in the body's id

https://pidgeon.ai/docs/webhooks

Index

Constants

View Source
const (
	// Name is the protocol's name
	Name = "pidgeon"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Protocol

type Protocol struct{}

Protocol is Pidgeon's protocol

func New

func New() Protocol

New returns the protocol

func (Protocol) Check added in v1.7.4

func (Protocol) Check(string, http.Header) error

Check returns nil, as it isn't known which calls Pidgeon doesn't make

func (Protocol) Decode

func (Protocol) Decode(header http.Header, body []byte) (json.RawMessage, error)

func (Protocol) Handshake

func (Protocol) Handshake(*http.Request, string) ([]byte, bool)

func (Protocol) Headers

func (Protocol) Headers() []string

func (Protocol) Identify

func (Protocol) Identify(header http.Header, values json.RawMessage) (string, string)

Identify returns Pidgeon-Event, or the body's type, such as message.received, and the body's id

func (Protocol) Name

func (Protocol) Name() string

func (Protocol) Sample added in v1.7.4

func (Protocol) Sample(delivery string) (http.Header, []byte)

Sample returns a call with a type

func (Protocol) Sign added in v1.7.4

func (Protocol) Sign(header http.Header, body []byte, secret string)

Sign sets Pidgeon-Signature, of now

func (Protocol) Verify

func (Protocol) Verify(header http.Header, body []byte, secret string) error

Verify returns nil when one of Pidgeon-Signature's v1 signatures is the HMAC-SHA256 of its time, a dot, and the body, with the secret, in hex, and its time is within five minutes of now

Jump to

Keyboard shortcuts

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