ws

package
v0.0.0-...-4b2051a Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 4 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 {
	// contains filtered or unexported fields
}

Client is an middleman between the websocket connection and the router.

type Router

type Router struct {

	// Inbound messages from the clients.
	Incoming chan []byte

	// Outgoing messages to the clients.
	Outgoing chan []byte
	// contains filtered or unexported fields
}

Router maintains the set of active clients and sends and receives messages to/from the clients.

func NewRouter

func NewRouter() *Router

func (*Router) ServeWs

func (router *Router) ServeWs(w http.ResponseWriter, r *http.Request)

ServeWs handles websocket requests from the peer.

func (*Router) Worker

func (r *Router) Worker()

Jump to

Keyboard shortcuts

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