hub

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DocAddedEvent   = "DocAdded"
	DocDeletedEvent = "DocDeleted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

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

Hub ws notificaiton hub

func NewHub

func NewHub() *Hub

NewHub construct a hub

func (*Hub) ClientCount

func (h *Hub) ClientCount() int

ClientCount number of connected clients

func (*Hub) ConnectWs

func (h *Hub) ConnectWs(uid, deviceID string, connection *websocket.Conn)

ConnectWs upgrade the connection to websocket

func (*Hub) Notify

func (h *Hub) Notify(uid, deviceID string, doc *messages.RawDocument, eventType string)

Notify sends a message to all connected clients

Jump to

Keyboard shortcuts

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