Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶ added in v0.14.2
type Handler interface { // Initialize the handler Init(jsonconf string) error // Check if the handler is initialized IsReady() bool // Push returns a channel that the server will use to send messages to. // The message will be dropped if the channel blocks. Push() chan<- *Receipt // Stop operations Stop() }
Handler is an interface which must be implemented by handlers.
type Payload ¶
type Payload struct { Topic string `json:"topic"` // Google is retarded. "from" is a reserved keyword in FCM From string `json:"xfrom"` Timestamp time.Time `json:"ts"` SeqId int `json:"seq"` // Actual Data.Content of the message, if requested Content interface{} `json:"content,omitempty"` }
Payload is content of the push.
type Receipt ¶
type Receipt struct { // List of recipients, including those who did not receive the message To []Recipient `json:"to"` // Actual content to be delivered to the client Payload Payload `json:"payload"` }
Receipt is the push payload with a list of recipients.
type Recipient ¶ added in v0.14.2
type Recipient struct { // Addresse User t.Uid `json:"user"` // Count of user's connections that were live when the packet was dispatched from the server Delivered int `json:"delivered"` // List of user's devices that the packet was delivered to (if known). Len(Devices) >= Delivered Devices []string `json:"devices,omitempty"` }
Recipient is a user targeted by the push.
Click to show internal directories.
Click to hide internal directories.