hub

package
v0.0.0-...-d6aed12 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Connection *websocket.Conn
	Send       chan []byte
	ClientInfo *ClientInfo
}

Client ...

type ClientInfo

type ClientInfo struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Token string `json:"token"`
}

ClientInfo ...

type Hub

type Hub struct {
	Buffer     []byte
	Clients    map[*Client]bool
	Broadcast  chan []byte
	Register   chan *Client
	Unregister chan *Client
}

Hub ...

func NewHub

func NewHub() *Hub

NewHub ...

func (*Hub) Run

func (h *Hub) Run()

Run ...

Jump to

Keyboard shortcuts

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