package
0.0.0-20241224121820-847fb65f4f5b
Repository: https://github.com/rubyniu105/framework.git
Documentation: pkg.go.dev
# Functions
BroadcastMessage send broadcast message to channel and record stats.
HandleWebSocketCommand used to register command and handler.
InitWebSocket start websocket.
No description provided by the author
ServeWs handles websocket requests from the peer.
# Constants
ConfigMessage used to send configuration.
PrivateMessage means message is 1 to 1.
PublicMessage means broadcast message.
# Structs
Hub maintains the set of active connections and broadcasts messages to the connections.
WebsocketConnection is an middleman between the websocket connection and the hub.
# Type aliases
MsgType is the type of different message.
WebsocketHandlerFunc define the func to handle websocket.