counter

package
v0.0.0-...-205cd9e Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 License: MIT Imports: 2 Imported by: 0

README

About this package

This package is here only to make live counter on the homepage work and is therefore kind of irrelevant to the project's core functionality.

This might end up in another repo, in cmd folder or deleted entirely.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// The websocket connection.
	Conn *websocket.Conn

	// Buffered channel of outbound messages.
	Send chan []byte
}

Client is a middleman between the websocket connection and the hub.

func (*Client) WaitMessages

func (c *Client) WaitMessages()

type Hub

type Hub struct {
	// Registered Clients.
	Clients map[*Client]bool

	// Inbound messages from the Clients.
	Broadcast chan []byte

	// Register requests from the Clients.
	Register chan *Client

	// UnRegister requests from Clients.
	Unregister chan *Client
}

func NewHub

func NewHub() *Hub

func (*Hub) Run

func (h *Hub) Run()

Jump to

Keyboard shortcuts

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