Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶ added in v0.0.2
func NewServer(options ServerOptions) *server
Types ¶
type ServerConfigError ¶ added in v0.0.3
type ServerOptions ¶ added in v0.0.3
type WsClient ¶ added in v0.0.2
type WsClient struct {
// contains filtered or unexported fields
}
func NewWsClient ¶ added in v0.0.2
func (*WsClient) HandleReads ¶ added in v0.0.2
func (c *WsClient) HandleReads()
func (*WsClient) HandleWrites ¶ added in v0.0.2
func (c *WsClient) HandleWrites()
HandleWrites writes messages from the hub to the websocket connection.
A goroutine running writePump is started for each connection. The application ensures that there is at most one writer to a connection by executing all writes from this goroutine.
type WsHub ¶ added in v0.0.2
type WsHub struct { // Inbound messages from the clients. Broadcast chan []byte // Register requests from the clients. Register chan *WsClient // Unregister requests from clients. Unregister chan *WsClient // contains filtered or unexported fields }
WsHub maintains the set of active clients and broadcasts messages to the clients.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.