peergov

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PeerSourceUnknown               = 0
	PeerSourceTopologyLocalRoot     = 1
	PeerSourceTopologyPublicRoot    = 2
	PeerSourceTopologyBootstrapPeer = 3
	PeerSourceP2PLedger             = 4
	PeerSourceP2PGossip             = 5
	PeerSourceInboundConn           = 6
)
View Source
const (
	OutboundConnectionEventType = "peergov.outbound-conn"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OutboundConnectionEvent

type OutboundConnectionEvent struct {
	ConnectionId ouroboros.ConnectionId
}

type Peer

type Peer struct {
	Address        string
	Source         PeerSource
	ConnectionId   *ouroboros.ConnectionId
	Sharable       bool
	ReconnectCount int
	ReconnectDelay time.Duration
}

type PeerGovernor

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

func NewPeerGovernor

func NewPeerGovernor(cfg PeerGovernorConfig) *PeerGovernor

func (*PeerGovernor) GetPeers

func (p *PeerGovernor) GetPeers() []Peer

func (*PeerGovernor) LoadTopologyConfig

func (p *PeerGovernor) LoadTopologyConfig(
	topologyConfig *topology.TopologyConfig,
)

func (*PeerGovernor) Start

func (p *PeerGovernor) Start() error

type PeerGovernorConfig

type PeerGovernorConfig struct {
	Logger      *slog.Logger
	EventBus    *event.EventBus
	ConnManager *connmanager.ConnectionManager
}

type PeerSource

type PeerSource uint16

Jump to

Keyboard shortcuts

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