Versions in this module Expand all Collapse all v0 v0.1.0 Jul 5, 2021 Changes in this version + func AuthKeyFromBytes(bytes []byte) (*ecdsa.PrivateKey, error) + func AuthKeyFromFile(filename string) (*ecdsa.PrivateKey, error) + func VerifyJWT(token string, pub *ecdsa.PublicKey) (bool, error) + type DeviceToken struct + Token string + Topic string + Unregistered int64 + type DeviceTokenFunc func(token string) *DeviceToken + type Handler struct + DeviceToken DeviceTokenFunc + Push PushFunc + TokenPublicKey TokenPublicKeyFunc + func NewHandler(keyFunc TokenPublicKeyFunc, tokenFunc DeviceTokenFunc, pushFunc PushFunc) *Handler + func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type Push struct + Headers http.Header + ID string + Payload []byte + Reason string + Status int + Timestamp int64 + type PushFunc func(push *Push) + type Token struct + IssuedAt int64 + KeyID string + TeamID string + func DecodeToken(bearer string) (*Token, error) + func (t *Token) Expired() bool + type TokenPublicKeyFunc func(keyID, teamID string) *ecdsa.PublicKey