Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // JoinRequest the validation rules joining the chat room. JoinRequest = validation.RuleSet{ "name": validation.List{"required", "string", "between:3,50"}, } )
Functions ¶
This section is empty.
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 {
// 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.
Click to show internal directories.
Click to hide internal directories.