Help us shape the future of Go! Take the 2026 Go Developer Survey

simulate

package
v0.57.18 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestConnectivity

func TestConnectivity(ctx context.Context, px0, px1 *Peer) error

TestConnectivity tests for basic connectivity between two peers. Uses an echo test: dials the Echo controller.

Types

type Peer

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

Peer holds state about an executing Peer

func (*Peer) Close

func (p *Peer) Close()

Close cancels the Peer's subroutines.

func (*Peer) GetInproc

func (p *Peer) GetInproc() *inproc.Inproc

GetInproc returns the in-proc transport.

func (*Peer) GetLogger

func (p *Peer) GetLogger() *logrus.Entry

GetLogger returns the logger for the peer.

func (*Peer) GetPeerID

func (p *Peer) GetPeerID() bp.ID

GetPeerID returns the Peer ID.

func (*Peer) GetPeerPriv

func (p *Peer) GetPeerPriv() crypto.PrivKey

GetPeerPriv returns the Peer private key.

func (*Peer) GetTestbed

func (p *Peer) GetTestbed() *testbed.Testbed

GetTestbed returns the testbed.

func (*Peer) GetTransportController

func (p *Peer) GetTransportController() *transport_controller.Controller

GetTransportController returns the transport controller.

type Simulator

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

Simulator manages state for all simulated machines.

func NewSimulator

func NewSimulator(
	ctx context.Context,
	le *logrus.Entry,
	grp *graph.Graph,
	opts ...SimulatorOption,
) (*Simulator, error)

NewSimulator constructs a new sim.

func (*Simulator) Close

func (s *Simulator) Close()

Close closes the simulator.

func (*Simulator) GetPeerByID

func (s *Simulator) GetPeerByID(id bpeer.ID) *Peer

GetPeerByID returns a peer by ID.

type SimulatorOption

type SimulatorOption func(s *Simulator) error

SimulatorOption is an option passed to NewSimulator.

func WithVerbose

func WithVerbose() SimulatorOption

WithVerbose enables verbose logging.

Jump to

Keyboard shortcuts

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