Versions in this module Expand all Collapse all v1 v1.0.1 Sep 6, 2025 Changes in this version + const MaxRecordSize + var ErrRecordSizeTooSmall = errors.New("record size too small for message") + func EncryptNotification(message []byte, keys Keys, recordSize uint32) ([]byte, error) + func SendNotification(ctx context.Context, message []byte, s *Subscription, options *Options) (*http.Response, error) + type HTTPClient interface + Do func(*http.Request) (*http.Response, error) + type Keys struct + Auth [16]byte + P256dh *ecdh.PublicKey + func DecodeSubscriptionKeys(auth, p256dh string) (keys Keys, err error) + func (k *Keys) Equal(o Keys) bool + func (k *Keys) MarshalJSON() ([]byte, error) + func (k *Keys) UnmarshalJSON(b []byte) (err error) + type Options struct + HTTPClient HTTPClient + RecordSize uint32 + Subscriber string + TTL int + Topic string + Urgency Urgency + VAPIDKeys *VAPIDKeys + VapidExpiration time.Time + type Subscription struct + Endpoint string + ExpirationTime time.Time + Keys Keys + type Urgency string + const UrgencyHigh + const UrgencyLow + const UrgencyNormal + const UrgencyVeryLow + type VAPIDKeys struct + func ECDSAToVAPIDKeys(privKey *ecdsa.PrivateKey) (result *VAPIDKeys, err error) + func GenerateVAPIDKeys() (result *VAPIDKeys, err error) + func LoadVAPIDPrivateKeyPEM(pemBytes []byte) (*VAPIDKeys, error) + func (v *VAPIDKeys) Equal(o *VAPIDKeys) bool + func (v *VAPIDKeys) ExportVAPIDPrivateKeyPEM() ([]byte, error) + func (v *VAPIDKeys) MarshalJSON() ([]byte, error) + func (v *VAPIDKeys) PrivateKey() *ecdsa.PrivateKey + func (v *VAPIDKeys) PublicKeyString() string + func (v *VAPIDKeys) UnmarshalJSON(b []byte) error v0 v0.0.1 Sep 5, 2025