send

package
v0.0.0-...-26d6cb3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPushRequest

func NewPushRequest(sub *auth.Subscription, message string, token string) (*http.Request, error)

NewPushRequest creates a valid Web Push HTTP request for sending a message to a subscriber. If the push service requires an authentication header (notably Google Cloud Messaging, used by Chrome) then you can add that as the token parameter. Deprecated - token auth is not part of the spec.

func NewRequest

func NewRequest(to *auth.Subscription, message string, ttlSec int, vapid *auth.Vapid) (*http.Request, error)

NewVapidRequest creates a valid Web Push HTTP request for sending a message to a subscriber, using Vapid authentication. You can add more headers to configure collapsing, TTL.

func Send

func Send(client *http.Client, sub *auth.Subscription, message, token string) (*http.Response, error)

Send a message using the Web Push protocol to the recipient identified by the given subscription object. If the client is nil then the default HTTP client will be used. If the push service requires an authentication header (notably Google Cloud Messaging, used by Chrome) then you can add that as the token parameter.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL