Documentation ¶
Overview ¶
Package protocol has code to talk the client-daemon<->push-server protocol.
Index ¶
Constants ¶
View Source
const ProtocolWireVersion = 0
View Source
const SystemChannelId = "0"
System channel id using a shortened hex encoded form for the NIL UUID
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BroadcastMsg ¶
type BroadcastMsg struct { Type string `json:"T"` AppId string `json:",omitempty"` ChanId string TopLevel int64 Payloads []json.RawMessage // contains filtered or unexported fields }
BROADCAST messages
func (*BroadcastMsg) Split ¶
func (m *BroadcastMsg) Split() bool
type ConnAckMsg ¶
type ConnAckMsg struct { Type string `json:"T"` Params ConnAckParams }
CONNACK message
type ConnAckParams ¶
type ConnAckParams struct { // ping interval formatted time.Duration PingInterval string }
ConnAckParams carries the connection parameters from the server on connection acknowledment.
type ConnectMsg ¶
type ConnectMsg struct { Type string `json:"T"` ClientVer string DeviceId string Info map[string]interface{} `json:",omitempty"` // platform etc... // maps channel ids (hex encoded UUIDs) to known client channel levels Levels map[string]int64 }
CONNECT message
type Notification ¶
type Notification struct { AppId string `json:"A"` MsgId string `json:"M"` // payload Payload json.RawMessage `json:"P"` }
A single unicast notification
type NotificationsMsg ¶
type NotificationsMsg struct { Type string `json:"T"` Notifications []Notification }
NOTIFICATIONS message
type Protocol ¶
type Protocol interface { SetDeadline(t time.Time) ReadMessage(msg interface{}) error WriteMessage(msg interface{}) error }
Protocol is a connection capable of writing and reading the wire format of protocol messages.
func NewProtocol0 ¶
NewProtocol0 creates and initialises a protocol with wire format version 0.
type SplittableMsg ¶
type SplittableMsg interface {
Split() (done bool)
}
SplittableMsg are messages that may require and are capable of splitting.
Click to show internal directories.
Click to hide internal directories.