Documentation ¶
Index ¶
Constants ¶
View Source
const ( // when new message is sent to the chat EventSendMessage = "send_message" EventNewMessage = "new_message" EventChatChange = "change_room" )
Variables ¶
This section is empty.
Functions ¶
func ChatChangeHandler ¶
func SendMessageHandler ¶
Types ¶
type Event ¶
type Event struct { Type string `json:"type"` Payload json.RawMessage `json:"payload"` }
different types of messages sent over the websocket we can execute different actions according to the type
type Hub ¶
func (*Hub) RemoveClient ¶
type NewMessage ¶
type NewMessage struct { SendMessageEvent Sent time.Time `json:"sent"` }
message to be broadcasted to clients
type SendMessageEvent ¶
when payload is a message sent in chat from client
Click to show internal directories.
Click to hide internal directories.