peermgr

package
v1.21.0-rpc-p02-mirror... Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0, MIT Imports: 16 Imported by: 12

Documentation

Index

Constants

View Source
const (
	MaxFilPeers = 32
	MinFilPeers = 12
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FilPeerEvt added in v1.2.2

type FilPeerEvt struct {
	Type FilPeerEvtType
	ID   peer.ID
}

type FilPeerEvtType added in v1.2.2

type FilPeerEvtType int
const (
	AddFilPeerEvt FilPeerEvtType = iota
	RemoveFilPeerEvt
)

type MaybePeerMgr

type MaybePeerMgr struct {
	fx.In

	Mgr *PeerMgr `optional:"true"`
}

type PeerMgr

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

func NewPeerMgr

func NewPeerMgr(lc fx.Lifecycle, h host.Host, dht *dht.IpfsDHT, bootstrap dtypes.BootstrapPeers) (*PeerMgr, error)

func (*PeerMgr) AddFilecoinPeer

func (pmgr *PeerMgr) AddFilecoinPeer(p peer.ID)

func (*PeerMgr) Disconnect

func (pmgr *PeerMgr) Disconnect(p peer.ID)

func (*PeerMgr) GetPeerLatency

func (pmgr *PeerMgr) GetPeerLatency(p peer.ID) (time.Duration, bool)

func (*PeerMgr) Run

func (pmgr *PeerMgr) Run(ctx context.Context)

func (*PeerMgr) SetPeerLatency

func (pmgr *PeerMgr) SetPeerLatency(p peer.ID, latency time.Duration)

func (*PeerMgr) Stop added in v0.5.0

func (pmgr *PeerMgr) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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