Documentation ¶
Overview ¶
Package webpush implements the message encryption required by the Web Push protocol
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSigningKey ¶
func GenerateSigningKey() (*ecdsa.PrivateKey, error)
Types ¶
type PublicKey ¶
PublicKey is a point (X, Y) on the P-256 curve
func (*PublicKey) MarshalBinary ¶
func (*PublicKey) UnmarshalBinary ¶
type Subscription ¶
type Subscription struct { // The push endpoint URL, unique to the given push subscription Endpoint string // 16 random bytes generated by the user agent, called auth_secret in the // RFC 8291 encryption summary Auth []byte // The P-256 public key generated by the User Agent P256DH *PublicKey }
Subscription is a User Agent's push message subscription
func UnmarshalSubscription ¶
func UnmarshalSubscription(data []byte) (*Subscription, error)
type Urgency ¶
type Urgency string
Urgency allows battery powered devices to avoid expending power on less important messages by only fetching messages of a certain urgency
var ( // UrgencyVeryLow sends notifications to devices that are both connected // to power and on Wi-Fi UrgencyVeryLow Urgency = "very-low" // UrgencyLow includes devices that are on either power or Wi-Fi UrgencyLow Urgency = "low" // UrgencyNormal includes devices that are not connected to power nor Wi-Fi // with acceptable remaining battery life UrgencyNormal Urgency = "normal" // UrgencyHigh includes devices with low battery power UrgencyHigh Urgency = "high" )
Click to show internal directories.
Click to hide internal directories.