Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateVAPIDKeys ¶
GenerateVAPIDKeys will create a private and public VAPID key pair
func SendNotification ¶
SendNotification sends a push notification to a subscriptions endpoint Follows the Message Encryption for Web Push, and VAPID protocols
Types ¶
type HTTPClient ¶
HTTPClient is an exposed interface to pass in custom http.Client
type Options ¶
type Options struct { HTTPClient HTTPClient // Will replace with *http.Client by default if not included Subscriber string // Sub in VAPID JWT token TTL int // Set the TTL on the endpoint POST request VAPIDPrivateKey string // Used to sign VAPID JWT token }
Options are config and extra params needed to send a notification
type Subscription ¶
Subscription represents a PushSubscription object from the Push API
Click to show internal directories.
Click to hide internal directories.