aftership

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: 5 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 aftership is AfterShip Tracking's webhook protocol: its calls are signed, with the account's webhook secret, in aftership-hmac-sha256, and say what happened, and their delivery, in the body's event, and event_id

https://www.aftership.com/docs/tracking/webhook/webhook-signature

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Protocol

type Protocol struct{}

Protocol is AfterShip'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 AfterShip 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(_ http.Header, values json.RawMessage) (string, string)

Identify returns the body's event, such as tracking_update, and its event_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 an event

func (Protocol) Sign added in v1.7.4

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

Sign sets aftership-hmac-sha256

func (Protocol) Verify

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

Verify returns nil when aftership-hmac-sha256 is the body's HMAC-SHA256, with the secret, in base64

Jump to

Keyboard shortcuts

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