push

package
v0.0.0-...-a0d1ad3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Title string `json:"title"`
	Body  string `json:"body"`
	Icon  string `json:"icon"`
	Tag   string `json:"tag"`
}

func NewData

func NewData(title string, body string, icon string, tag string) *Data

type Push

type Push interface {
	Subscription()
	Send() error
}

type Subscription

type Subscription struct {
	DeviceID string
	Endpoint string
	Auth     string
	P256dh   string

	// VAPID KEY
	PublicKey  string
	PrivateKey string

	Data []byte
}

func NewSubscription

func NewSubscription(deviceID, endpoint, auth, p256dh, publicKey, privateKey string, data []byte) *Subscription

func (*Subscription) Send

func (s *Subscription) Send() error

func (*Subscription) Subscription

func (s *Subscription) Subscription()

Jump to

Keyboard shortcuts

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