Documentation
¶
Index ¶
Constants ¶
View Source
const ( REGISTER_SOCKET = iota + 1 MESSAGE PUBLISH_ROOM UNPUBLISH_ROOM SUBSCRIBE_TO_ROOM UNSUBSCRIBE_FROM_ROOM )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BroadcastMessage ¶
type BroadcastMessage struct { Type int `json:"type,omitempty" bson:"type,omitempty"` SocketID string `json:"socketId,omitempty" bson:"socketId,omitempty"` Room string `json:"room,omitempty" bson:"room,omitempty"` Channel string `json:"channel,omitempty" bson:"channel,omitempty"` Payload interface{} `json:"payload,omitempty" bson:"payload,omitempty"` }
type ClientMessage ¶
type ClientMessage struct { Type int `json:"type,omitempty" bson:"type,omitempty"` SocketID string `json:"socketId,omitempty" bson:"socketId,omitempty"` Room string `json:"room,omitempty" bson:"room,omitempty"` Channel string `json:"channel,omitempty" bson:"channel,omitempty"` Payload interface{} `json:"payload,omitempty" bson:"payload,omitempty"` }
type EmitMessage ¶
type EmitMessage struct { Type int `json:"type,omitempty" bson:"type,omitempty"` SocketID string `json:"socketId,omitempty" bson:"socketId,omitempty"` Channel string `json:"channel,omitempty" bson:"channel,omitempty"` Payload interface{} `json:"payload,omitempty" bson:"payload,omitempty"` JWT string `json:"jwt,omitempty" bson:"jwt,omitempty"` }
type Socket ¶
type Socket struct { WebSocket *WebSocket Conn *websocket.Conn Send chan []byte Rooms map[string]bool // PvtRooms map[string]bool SocketID string }
Socket is a middleman between the websocket connection and the websocket object.
Click to show internal directories.
Click to hide internal directories.