rendezvous

package
v0.81.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const IncomingRendezvousNexusName = "IncomingRendezvousNexus"

IncomingRendezvousNexusName is the nexues name.

View Source
const OutgoingRendezvousNexusName = "OutgoingRendezvousNexus"

OutgoingRendezvousNexusName is the name of the nexus.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directory added in v0.54.0

type Directory struct {

	// NexusesByUUID is a map from uuid to corresponding nexus
	NexusesByUUID map[string]nexusHelper.Nexus
	// RidsByUUIDs is a map from nexus uuid to corresponding rendezvous id
	RidsByUUIDs map[string]string
	// UnpeeredUUIDsByRid is a map of uuids that are currently unpaired sorted by rendezvous id
	UnpeeredUUIDsByRid map[string]string
	// UUIDPeers is a map of nexus to the uuid of the corresponding peer
	UUIDPeers map[string]string
	// RIDSPeered is a list of rids which are currently peered
	RIDSPeered []string
	// contains filtered or unexported fields
}

Directory stores nexus peering data.

func NewRendezvousDirectory

func NewRendezvousDirectory() *Directory

NewRendezvousDirectory creates a new RendezvousDirectory.

func (*Directory) AddNexus added in v0.54.0

func (r *Directory) AddNexus(nexus nexusHelper.Nexus, rendezvousID string)

AddNexus adds and indexes a nexus.

func (*Directory) GetPeerNexus added in v0.54.0

func (r *Directory) GetPeerNexus(nexusID uuid.UUID) *nexusHelper.Nexus

GetPeerNexus get matching peer of a given nexus (1:1 mapping).

func (*Directory) IsNexusInDirectory added in v0.54.0

func (r *Directory) IsNexusInDirectory(nexus nexusHelper.Nexus) bool

IsNexusInDirectory determines wether or not nexus is indexed in directory.

func (*Directory) IsRidPeered added in v0.54.0

func (r *Directory) IsRidPeered(rendezvousID string) bool

IsRidPeered checks if a rendezvous id currently has a peer.

func (*Directory) RemoveNexus added in v0.54.0

func (r *Directory) RemoveNexus(nexus nexusHelper.Nexus)

RemoveNexus removes a nexus from the directory.

func (*Directory) ToString added in v0.54.0

func (r *Directory) ToString() string

ToString gets the number of nexuses/peered/unpeered.

type IncomingRendezvousNexus

type IncomingRendezvousNexus struct {
	*base.NexusBase
	// contains filtered or unexported fields
}

IncomingRendezvousNexus manages rendezvous nexuses.

func NewIncomingRendezvousNexus

func NewIncomingRendezvousNexus(belowNexus nexus.Nexus, layer layer.Base, directory *Directory) *IncomingRendezvousNexus

NewIncomingRendezvousNexus creates a new IncomingRendezvousNexus.

func (*IncomingRendezvousNexus) EndRendezvous

func (i *IncomingRendezvousNexus) EndRendezvous()

EndRendezvous ends the rendezvous.

func (*IncomingRendezvousNexus) IsLayerMessage

IsLayerMessage determines wether or not the message acn be processed by the current layer.

func (*IncomingRendezvousNexus) OnBinMessage

func (i *IncomingRendezvousNexus) OnBinMessage(belowNexus nexus.Nexus, msgByte []byte)

OnBinMessage processes the binary message.

func (*IncomingRendezvousNexus) OnMessage

func (i *IncomingRendezvousNexus) OnMessage(belowNexus nexus.Nexus, msg message_base.MoneysocketMessage)

OnMessage processes the message.

func (*IncomingRendezvousNexus) RendezvousAcheived

func (i *IncomingRendezvousNexus) RendezvousAcheived()

RendezvousAcheived is called by other peer.

func (*IncomingRendezvousNexus) WaitForRendezvous

func (i *IncomingRendezvousNexus) WaitForRendezvous(rendezvousFinishedCb func(nexus.Nexus))

WaitForRendezvous waits for the rendezvous.

type OutgoingRendezvousNexus

type OutgoingRendezvousNexus struct {
	*base.NexusBase
	// contains filtered or unexported fields
}

OutgoingRendezvousNexus processes rendezvouses.

func NewOutgoingRendezvousNexus

func NewOutgoingRendezvousNexus(belowNexus nexus.Nexus, layer layer.Base) *OutgoingRendezvousNexus

NewOutgoingRendezvousNexus creates a OutgoingRendezvousNexus.

func (OutgoingRendezvousNexus) IsLayerMessage

IsLayerMessage determines weather or not the layer should process a message.

func (*OutgoingRendezvousNexus) OnBinMessage

func (o *OutgoingRendezvousNexus) OnBinMessage(belowNexus nexus.Nexus, msg []byte)

OnBinMessage processes a binary message.

func (*OutgoingRendezvousNexus) OnMessage

func (o *OutgoingRendezvousNexus) OnMessage(belowNexus nexus.Nexus, msg message_base.MoneysocketMessage)

OnMessage processes a message.

func (*OutgoingRendezvousNexus) StartRendezvous

func (o *OutgoingRendezvousNexus) StartRendezvous(rendevousID string, rendezvousFinishedCb func(nexus nexus.Nexus))

StartRendezvous starts a rnedezvous with rendezvous id/rendezvousFinishedCb.

Jump to

Keyboard shortcuts

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