ContactHub

package
v0.0.0-...-3625f0c Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeContactWs

func ServeContactWs(contactId string, hub *ContactHub, w http.ResponseWriter, r *http.Request, pingInterval int)

ServeContactWs serveWs handles websocket requests from the peer.

Types

type ContactClient

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

ContactClient Client is a middleman between the websocket connection and the hub.

type ContactEvent

type ContactEvent struct {
	ContactId        string                       `json:"contactId"`
	InteractionEvent model.InteractionEventCreate `json:"event"`
}

type ContactHub

type ContactHub struct {
	// Registered clients.
	Clients map[*ContactClient]bool

	// Inbound messages from the clients.
	Broadcast chan ContactEvent

	// Register requests from the clients.
	Register chan *ContactClient

	Quit chan bool
	// contains filtered or unexported fields
}

ContactHub Hub maintains the set of active clients and broadcasts messages to the clients.

func NewContactHub

func NewContactHub() *ContactHub

func (*ContactHub) Run

func (h *ContactHub) Run()

type Time

type Time struct {
	Seconds string `json:"seconds"`
	Nanos   string `json:"nanos"`
}

Jump to

Keyboard shortcuts

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