node

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Chains []chain.Chain
}

func NewRootNode

func NewRootNode(pubKey crypto.PubKey) Node

func (Node) AddChain

func (n Node) AddChain(c chain.Chain) (rn Node)

func (Node) CommonChain

func (n Node) CommonChain(their Node) chain.Chain

func (Node) CommonChains

func (n Node) CommonChains(their Node) []chain.Pair

CommonChains return slice of chain pairs. If no pairs can be found the slice is empty not nil.

func (Node) Invite

func (n Node) Invite(
	inviteesNode Node,
	invitersKey crypto.Key,
	inviteesPubKey crypto.PubKey,
	position int,
) (
	rn Node,
)

func (Node) IsInviterFor

func (n Node) IsInviterFor(their Node) bool

func (Node) Len

func (n Node) Len() int

func (Node) OneHop

func (n Node) OneHop(their Node) bool

func (Node) WebOfTrustInfo

func (n Node) WebOfTrustInfo(their Node) WebOfTrust

WebOfTrustInfo returns web-of-trust information of two nodes if they share a trust chain. If not the Hops field is chain.NotConnected.

type WebOfTrust

type WebOfTrust struct {
	// Hops tells how far the the other end is when traversing thru the
	// CommonInvider
	Hops int

	// CommonInviter from root, i.e. how far away it's from absolute root
	CommonInvider int

	// Position of the CommonInvider.
	Position int
}

func NewWebOfTrust

func NewWebOfTrust(n1, n2 Node) WebOfTrust

NewWebOfTrust returns web-of-trust information of two nodes if they share a trust chain. If not the Hops field is chain.NotConnected.

Jump to

Keyboard shortcuts

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