Documentation ¶
Index ¶
Constants ¶
View Source
const ( MessageTypeRoomJoin string = "ws_room_join" MessageTypeRoomLeave string = "ws_room_leave" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteSerializer ¶
type ByteSerializer struct{}
func (ByteSerializer) Deserialize ¶
func (s ByteSerializer) Deserialize(data []byte) (msg Message, err error)
type Deserializer ¶
type Message ¶
type Message struct { // Types 0-10 are reserved for base functionality, others can be used for // custom implementations. Type string `json:"type"` // Room this message is related to Room string `json:"room"` // Payload content Payload interface{} `json:"payload"` }
Simple message is a container for web-socket messages.
func NewMessage ¶
func NewMessageRoomJoin ¶
func NewMessageRoomLeave ¶
type Serializer ¶
Click to show internal directories.
Click to hide internal directories.