peermgr

package
v0.0.0-...-484cccf Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MaxFilPeers = 32
	MinFilPeers = 12
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FilPeerEvt

type FilPeerEvt struct {
	Type FilPeerEvtType
	ID   peer.ID
}

type FilPeerEvtType

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

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