Documentation
¶
Index ¶
- Constants
- type Ack
- type AckUpdate
- type AutoPushClient
- func (c *AutoPushClient) Decrypt(curve ecdh.Curve, authSecret []byte, useragentPrivateKey *ecdh.PrivateKey, ...) (*webpush.WebPushPayload, error)
- func (c *AutoPushClient) Hello(uaid string, channelIDs []string) (HelloResponse, error)
- func (c *AutoPushClient) Register(channelID string, vapidKey string) (RegisterResponse, error)
- func (c *AutoPushClient) Unregister(channelID string) (UnregisterResponse, error)
- type HelloRequest
- type HelloResponse
- type Message
- type MessageType
- type Notification
- type NotificationHeaders
- type RegisterRequest
- type RegisterResponse
- type Status
- type UnregisterRequest
- type UnregisterResponse
Constants ¶
View Source
const MOZILLA_PUSH_SERVICE = "wss://push.services.mozilla.com"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ack ¶
type Ack struct {
Type MessageType `json:"messageType"`
Updates []AckUpdate `json:"updates"`
}
type AutoPushClient ¶
type AutoPushClient struct {
*websocket.WebSocketClient
// contains filtered or unexported fields
}
func NewAutoPushClient ¶
func NewAutoPushClient() (ap *AutoPushClient, ch chan Notification)
func (*AutoPushClient) Decrypt ¶
func (c *AutoPushClient) Decrypt( curve ecdh.Curve, authSecret []byte, useragentPrivateKey *ecdh.PrivateKey, notification Notification, ) (*webpush.WebPushPayload, error)
func (*AutoPushClient) Hello ¶
func (c *AutoPushClient) Hello(uaid string, channelIDs []string) (HelloResponse, error)
func (*AutoPushClient) Register ¶
func (c *AutoPushClient) Register(channelID string, vapidKey string) (RegisterResponse, error)
func (*AutoPushClient) Unregister ¶
func (c *AutoPushClient) Unregister(channelID string) (UnregisterResponse, error)
type HelloRequest ¶
type HelloRequest struct {
Type MessageType `json:"messageType"`
UAID string `json:"uaid"`
ChannelIDs []string `json:"channelIDs"`
UseWebPush bool `json:"use_webpush,omitempty"`
}
type HelloResponse ¶
type HelloResponse struct {
Type MessageType `json:"messageType"`
UAID string `json:"uaid"`
Status Status `json:"status"`
UseWebPush bool `json:"use_webpush,omitempty"`
}
type Message ¶
type Message struct {
Type MessageType `json:"messageType"`
}
type MessageType ¶
type MessageType string
const ( PING MessageType = "ping" ACK MessageType = "ack" HELLO MessageType = "hello" REGISTER MessageType = "register" UNREGISTER MessageType = "unregister" NOTIFICATION MessageType = "notification" )
type Notification ¶
type Notification struct {
Type MessageType `json:"messageType"`
ChannelID string `json:"channelID"`
Version string `json:"version"`
Data string `json:"data"`
Headers NotificationHeaders `json:"headers"`
}
type NotificationHeaders ¶
type RegisterRequest ¶
type RegisterRequest struct {
Type MessageType `json:"messageType"`
ChannelID string `json:"channelID"`
Key string `json:"key"`
}
type RegisterResponse ¶
type RegisterResponse struct {
Type MessageType `json:"messageType"`
ChannelID string `json:"channelID"`
Status Status `json:"status"`
PushEndpoint string `json:"pushEndpoint"`
}
type UnregisterRequest ¶
type UnregisterRequest struct {
Type MessageType `json:"messageType"`
ChannelID string `json:"channelID"`
}
type UnregisterResponse ¶
type UnregisterResponse struct {
Type MessageType `json:"messageType"`
ChannelID string `json:"channelID"`
Status Status `json:"status"`
}
Click to show internal directories.
Click to hide internal directories.