Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerMessage ¶
type PeerMessage struct {
// ID **must** only contain alphanumeric characters separated by period.
ID string // A unique Message ID (primarily used for acknowledgments)
// Context **must** only contain alphanumeric characters separated by period.
Context string // A unique context identifier i.e. im.cwtch.chat
// Data can contain anything
Data []byte // A data packet.
}
PeerMessage is an encapsulation that can be used by higher level applications
func ParsePeerMessage ¶ added in v0.14.17
func ParsePeerMessage(message []byte) (*PeerMessage, error)
ParsePeerMessage returns either a deserialized PeerMessage or an error if it is malformed
func (*PeerMessage) Serialize ¶ added in v0.14.17
func (m *PeerMessage) Serialize() []byte
Serialize constructs an efficient serialized representation Format: [ID String] | [Context String] | Binary Data
Click to show internal directories.
Click to hide internal directories.