nexus

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 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 {
	// get the id for a given nexus
	Uuid() uuid.UUID
	// wether or not two nexuses are equal
	IsEqual(n Nexus) bool
	// called on a message, set in constructor
	OnMessage(belowNexus Nexus, msg base.MoneysocketMessage)
	// called on a binary message, set in constructor
	OnBinMessage(belowNexus Nexus, msg []byte)
	// list all nexuses
	GetDownwardNexusList() []Nexus
	// send a message
	Send(msg base.MoneysocketMessage) error
	// send a binary message
	SendBin(msg []byte) error
	// initiate a close
	InitiateClose()
	// 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)
}

type OnBinMessage

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

type OnMessage

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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