Documentation ¶
Overview ¶
Simple Websock Library for Go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { //Use to distinguish connections. //Default is 1 Id int // The websocket Connection. Conn *websocket.Conn // Channel to send to client Send chan []byte // contains filtered or unexported fields }
Client is a connection between the server and client
type Hub ¶
type Hub struct { // Registered Clients. Clients map[*Client]bool // Inbound messages from the Clients. Messages map[int]string // Last Message to Hub Input chan MessageBlock // contains filtered or unexported fields }
Connection router that registers connections and handles read/write to them
type MessageBlock ¶
type MessageBlock struct { //Client that sent Message Client *Client //The message sent to the server Message string }
MessageBlock is a struct containing a message and a *Client of the client that sent the message
Click to show internal directories.
Click to hide internal directories.