Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinRequest ¶
JoinRequest the query validation rules joining the chat room.
Types ¶
type Client ¶
type Client struct { Name string // contains filtered or unexported fields }
Client is a middleman between the websocket connection and the hub.
type Hub ¶
type Hub struct { goyave.Component // contains filtered or unexported fields }
Hub maintains the set of active clients and broadcasts messages to the clients.
func (*Hub) Broadcast ¶
Broadcast send a message to all connected clients. This method is concurrently safe and doesn't do anything is the Hub's context is canceled.
func (*Hub) RegisterRoute ¶
func (h *Hub) RegisterRoute(router *goyave.Router, handler goyave.Handler)
RegisterRoute regsiters the websocket route with validation.
Click to show internal directories.
Click to hide internal directories.