ws

package
v0.0.0-...-506f97f Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDesc

func AddDesc(d *parser.BabelDesc)

func GetDesc

func GetDesc(id parser.Id) *parser.BabelDesc

func Handler

func Handler(l *Listenergroup) http.Handler

Handler manage the websockets

func Init

func Init()

func RemoveDesc

func RemoveDesc(id parser.Id)

Types

type Listener

type Listener struct {
	Channel chan parser.SBabelUpdate
}

Listener unique channel for each ws

func NewListener

func NewListener() *Listener

NewListener function to call if you want a new Listener

type Listenergroup

type Listenergroup struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Listenergroup list of all the Listeners for the multicast

func NewListenerGroup

func NewListenerGroup() *Listenergroup

NewListenerGroup function to call if you want a new Listenergroup

func (*Listenergroup) Flush

func (g *Listenergroup) Flush(l *Listener)

Flush remove a Listener from the Listenergroup

func (*Listenergroup) Iter

func (g *Listenergroup) Iter(routine func(*Listener))

Iter Call the routine for each Listener

func (*Listenergroup) Push

func (g *Listenergroup) Push(newListener *Listener)

Push add a Listener to the Listenergroup

Jump to

Keyboard shortcuts

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