Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseMessage ¶
type BaseMessage struct { ID string `json:"id"` MessageType string `json:"type"` From string `json:"from,omitempty"` To string `json:"to,omitempty"` Ok bool `json:"ok"` Payload map[string]interface{} `json:"payload"` }
BaseMessage is a basic message model, basis of the whole protocol. It is used for a very easy protocol extension process.
func NewBaseMessage ¶
func NewBaseMessage(id, messageType, from string, to string, ok bool, payload map[string]interface{}) BaseMessage
func NewEmptyBaseMessage ¶
func NewEmptyBaseMessage() BaseMessage
type EntityID ¶
type EntityID struct { Type EntityIDType LocalPart string ServerPart string Attr string OnlyServerPart bool }
func NewEntityID ¶
func NewEntityIDFromString ¶
func NewEntityIDWithAttr ¶
type EntityIDType ¶
type EntityIDType string
const ( UsernameType EntityIDType = "@" ChatAliasType EntityIDType = "#" ChatIDType EntityIDType = "!" ThirdPIDType EntityIDType = "%" OtherType EntityIDType = "&" )
type ProtocolError ¶
Click to show internal directories.
Click to hide internal directories.