hub

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentNotification added in v0.0.5

type DocumentNotification struct {
	ID      string
	Type    common.EntryType
	Version int
	Parent  string
	Name    string
}

DocumentNotification notification of something

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 DocumentNotification, eventType messages.NotificationType)

Notify sends a message to all connected clients

func (*Hub) NotifySync added in v0.0.5

func (h *Hub) NotifySync(uid, deviceID string) string

NotifySync sends a message to all connected clients 1.5

Jump to

Keyboard shortcuts

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