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
- type Protocol
- func (Protocol) Check(string, http.Header) error
- func (Protocol) Decode(header http.Header, body []byte) (json.RawMessage, error)
- func (Protocol) Handshake(*http.Request, string) ([]byte, bool)
- func (Protocol) Headers() []string
- func (Protocol) Identify(_ http.Header, values json.RawMessage) (string, string)
- func (Protocol) Name() string
- func (Protocol) Sample(delivery string) (http.Header, []byte)
- func (Protocol) Sign(header http.Header, body []byte, secret string)
- func (Protocol) Verify(header http.Header, body []byte, secret string) error
Constants ¶
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 (Protocol) Check ¶ added in v1.7.4
Check returns nil, as it isn't known which calls AfterShip doesn't make
func (Protocol) Identify ¶
Identify returns the body's event, such as tracking_update, and its event_id