nexus

package
v0.87.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Nexus

type Nexus interface {
	// UUID gets the id for a given nexus
	UUID() uuid.UUID
	// IsEqual is wether or not two nexuses are equal
	IsEqual(n Nexus) bool
	// OnMessage is called on a message, set in constructor
	OnMessage(belowNexus Nexus, msg base.MoneysocketMessage)
	// OnBinMessage is called on a binary message, set in constructor
	OnBinMessage(belowNexus Nexus, msg []byte)
	// GetDownwardNexusList lists all nexuses
	GetDownwardNexusList() []Nexus
	// Send sends a message
	Send(msg base.MoneysocketMessage) error
	// SendBin sends a binary message
	SendBin(msg []byte) error
	// InitiateClose initiates a close
	InitiateClose()
	// SharedSeed gets a shared seed
	SharedSeed() *beacon.SharedSeed
	// get name of the nexus
	Name() string
	// set a on message callback.
	// This overrides the default (calling on message on below nexus if below nexus is present)
	SetOnMessage(messageFunc OnMessage)
	// set a callback for a binary message
	SetOnBinMessage(messageBinFunc OnBinMessage)
}

Nexus is the nexus interface.

type OnBinMessage

type OnBinMessage = func(belowNexus Nexus, msg []byte)

OnBinMessage is a handler function for processing a binary message.

type OnMessage

type OnMessage = func(belowNexus Nexus, msg base.MoneysocketMessage)

OnMessage is a handler function for processing a base.MoneysocketMessage.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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