websocket

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//JSONComunication is the constant that indicates a JSON sommunication
	JSONComunication = "JSON"
)

Variables

This section is empty.

Functions

func AddAction

func AddAction(name string, action Action)

AddAction adds an action to a map of actions, overwrites already set functions

func Handle

func Handle(w http.ResponseWriter, r *http.Request)

Handle handles the websocket connection

func SendUpdate

func SendUpdate()

SendUpdate sends an update request to all the WS clients

Types

type Action

type Action func() error

Action is an action activatable by WS connections

type Connection

type Connection struct {
	*websocket.Conn
	// contains filtered or unexported fields
}

Connection is the type used to represent a connection

type ID

type ID [letterIdxMax]byte

ID is the ID type used for websocket connections

Jump to

Keyboard shortcuts

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