rendezvous

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

handlers.go sepcifies the websocket handlers that rendezvous server uses to facilitate communcation between sender and receiver.

id.go specifies the central datastructure used to keep track of connection ids.

mailbox.go defines the central datastructure that keeps track of the different connections.

Index

Constants

View Source
const RECEIVER_CONNECT_TIMEOUT time.Duration = 5 * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type IDs

type IDs struct{ *sync.Map }

IDs is a threadsafe set of numbers.

func (*IDs) Bind

func (ids *IDs) Bind() int

Bind binds an id to connection.

type Mailbox

type Mailbox struct {
	Receiver chan []byte // messages to Receiver
	Sender   chan []byte // messages to Sender
	// contains filtered or unexported fields
}

Mailbox is a data structure that links together a sender and a receiver client.

type Mailboxes

type Mailboxes struct{ *sync.Map }

func (*Mailboxes) DeleteMailbox

func (mailboxes *Mailboxes) DeleteMailbox(p string)

DeleteMailbox deallocates a mailbox.

func (*Mailboxes) GetMailbox

func (mailboxes *Mailboxes) GetMailbox(p string) (*Mailbox, error)

GetMailbox returns the desired mailbox.

func (*Mailboxes) StoreMailbox

func (mailboxes *Mailboxes) StoreMailbox(p string, m *Mailbox)

StoreMailbox allocates a mailbox.

type Server

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

Server is contains the necessary data to run the rendezvous server.

func NewServer

func NewServer(port int, version semver.Version) *Server

NewServer constructs a new Server struct and setups the routes.

func (*Server) Start

func (s *Server) Start()

Start runs the rendezvous server.

Jump to

Keyboard shortcuts

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