network

package
v0.0.0-...-99f10aa Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accept

type Accept struct{ Peer signing.ID }

type Accepted

type Accepted struct{ Peer signing.ID }

type Bitmask

type Bitmask uint64

func (Bitmask) AllSet

func (s Bitmask) AllSet(r Bitmask) bool

func (Bitmask) AnySet

func (s Bitmask) AnySet(r Bitmask) bool

func (*Bitmask) Clear

func (s *Bitmask) Clear(i int)

func (Bitmask) Count

func (s Bitmask) Count() int

func (Bitmask) Except

func (s Bitmask) Except(i int) Bitmask

func (Bitmask) IsSet

func (s Bitmask) IsSet(i int) bool

func (*Bitmask) Set

func (s *Bitmask) Set(i int)

type Connect

type Connect [2][32]byte

func (*Connect) String

func (m *Connect) String() string

type DidResume

type DidResume struct{ Tick uint64 }

type Disconnect

type Disconnect struct {
	Peer   signing.ID
	Reason string
}

type Disconnected

type Disconnected struct {
	Peer   signing.ID
	Reason string
}

type Entry

type Entry = eventlog.Entry[Event]

type Event

type Event interface {
	// contains filtered or unexported methods
}

type Invalid

type Invalid struct {
	Entry *Entry
	Error error
}

type Network

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

func (*Network) Active

func (n *Network) Active() iter.Seq[signing.ID]

func (*Network) Apply

func (n *Network) Apply(entry *Entry, emit func(Signal))

func (*Network) Clone

func (n *Network) Clone() *Network

func (*Network) Connect

func (n *Network) Connect(a, b signing.ID)

func (*Network) Connected

func (n *Network) Connected() iter.Seq[signing.ID]

func (*Network) IsAcceptedBy

func (n *Network) IsAcceptedBy(src, target signing.ID) bool

func (*Network) IsActive

func (n *Network) IsActive(id signing.ID) bool

func (*Network) IsKnown

func (n *Network) IsKnown(id signing.ID) bool

func (*Network) IsResumed

func (n *Network) IsResumed(id signing.ID) bool

func (*Network) IsResuming

func (n *Network) IsResuming(id signing.ID) bool

func (*Network) MutuallyAccepted

func (n *Network) MutuallyAccepted(id signing.ID) bool

func (*Network) NextHopTo

func (n *Network) NextHopTo(src, dst signing.ID) (signing.ID, bool)

NextHopTo returns the ID of the peer that src should send to in order to reach dst. BFS outward from dst; the first node found that is directly connected to src is the correct next hop. Since connections are symmetric, walking the graph in reverse is equivalent to walking it forward.

func (*Network) State

func (n *Network) State() State

type Pause

type Pause struct{}

type Paused

type Paused struct{}

type Reject

type Reject struct{ Peer signing.ID }

type Rejected

type Rejected struct{ Peer signing.ID }

type Resuming

type Resuming struct{ Peers []signing.ID }

type Signal

type Signal interface {
	// contains filtered or unexported methods
}

type State

type State int
const (
	IsPaused State = iota
	IsResuming
	IsTicking
)

type Tick

type Tick struct {
	Intents map[signing.ID][]any
}

type Ticking

type Ticking struct{}

type WhoAmI

type WhoAmI [32]byte

func (*WhoAmI) String

func (m *WhoAmI) String() string

type WillResume

type WillResume struct{}

Jump to

Keyboard shortcuts

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