util

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chat

func Chat(conn io.ReadWriter)

Chat simulates a simple text chat session over the connection

func Check

func Check(err error)

Check is a helper to throw errors in the examples

Types

type Hub added in v1.4.0

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

Hub is a helper to handle one to many chat

func NewHub added in v1.4.0

func NewHub() *Hub

NewHub builds a new hub

func (*Hub) Chat added in v1.4.0

func (h *Hub) Chat()

Chat starts the stdin readloop to dispatch messages to the hub

func (*Hub) Register added in v1.4.0

func (h *Hub) Register(conn net.Conn)

Register adds a new conn to the Hub

Jump to

Keyboard shortcuts

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