ws_hub

package
v0.0.0-...-da1daef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2015 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WsConnection

type WsConnection struct {
	// contains filtered or unexported fields
}

WebSocket connection

func (*WsConnection) WriterLoop

func (conn *WsConnection) WriterLoop()

Write loop

type WsHub

type WsHub struct {
	// contains filtered or unexported fields
}

WebSocket connections hub

func New

func New() *WsHub

Instanciates a new WebSocket hub

func Run

func Run() *WsHub

Instanciates a new WebSocket hub and run it

func (*WsHub) RegisterConn

func (hub *WsHub) RegisterConn(wsConn *websocket.Conn) *WsConnection

Register a new WebSocket connection

func (*WsHub) SendMsg

func (hub *WsHub) SendMsg(msg []byte)

Broadcast message to all registered WebSocket connections

func (*WsHub) UnregisterConn

func (hub *WsHub) UnregisterConn(conn *WsConnection)

Unregister a WebSocket connection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL