hub

package
v0.0.0-...-0ba1a38 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

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

Hub maintains the set of active connections and broadcasts messages to the connections.

func New

func New() *Hub

New creates a new Hub and starts it in a background Go routine.

func (*Hub) BroadcastRoom

func (h *Hub) BroadcastRoom(msg []byte, rm *db.Room)

BroadcastRoom sends a message to everyone in a room.

func (*Hub) Register

func (h *Hub) Register(ws *websocket.Conn, rm *db.Room)

Register associates a connection with the hub and a given room.

Jump to

Keyboard shortcuts

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