subscription

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Get

type Get struct {
	IDs        []jmap.ID `json:"ids,omitempty"`
	Properties []string  `json:"properties,omitempty"`
}

Get push subscription details https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2.1

func (*Get) Name

func (m *Get) Name() string

func (*Get) Requires

func (m *Get) Requires() []jmap.URI

type GetResponse

type GetResponse struct {
	List     []*PushSubscription `json:"list,omitempty"`
	NotFound []jmap.ID           `json:"notFound,omitempty"`
}

type Key

type Key struct {
	// The public key, base64 encoded
	Public string `json:"p256dh"`
	// The authentication secret, base64 encoded
	Auth string `json:"auth"`
}

A Push Subscription Encryption key. This key must be a P-256 ECDH key

type PushSubscription

type PushSubscription struct {
	ID jmap.ID `json:"id,omitempty"`

	DeviceClientID string `json:"deviceClientId,omitempty"`

	URL string `json:"url,omitempty"`

	Keys *Key `json:"keys,omitempty"`

	VerificationCode string `json:"verificationCode,omitempty"`

	Expires *time.Time `json:"expires,omitempty"`

	Types []string `json:"types,omitempty"`
}

Server side push notification https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2

type Set

type Set struct {
	Create  map[jmap.ID]*PushSubscription `json:"create,omitempty"`
	Update  map[jmap.ID]*jmap.Patch       `json:"update,omitempty"`
	Destroy []jmap.ID                     `json:"destroy,omitempty"`
}

Modify push subscription details https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2.2

func (*Set) Name

func (m *Set) Name() string

func (*Set) Requires

func (m *Set) Requires() []jmap.URI

type SetResponse

type SetResponse struct {
	Created      map[jmap.ID]*PushSubscription `json:"created,omitempty"`
	Updated      map[jmap.ID]*PushSubscription `json:"updated,omitempty"`
	Destroyed    []jmap.ID                     `json:"destroyed,omitempty"`
	NotCreated   map[jmap.ID]*jmap.SetError    `json:"notCreated,omitempty"`
	NotUpdated   map[jmap.ID]*jmap.SetError    `json:"notUpdated,omitempty"`
	NotDestroyed map[jmap.ID]*jmap.SetError    `json:"notDestroyed,omitempty"`
}

type Verification

type Verification struct {
	// The MUST be "PushVerification"
	Type string `json:"@type,omitempty"`

	// The ID of the Push Subscription that was created
	SubscriptionID string `json:"pushSubscriptionId,omitempty"`

	// The verification code to add to the subscription
	Code string `json:"verificationCode,omitempty"`
}

A PushVerification object is sent by the server to the created Subscriptions' URL.

Jump to

Keyboard shortcuts

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