peerstore

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LatencyEWMASmoothing = 0.1

LatencyEWMASmoothing 控制EWMA的衰减(变化速度) 这必须是一个归一化的(0-1)值 1表示100%变化,0表示无变化

Functions

func NewMetrics

func NewMetrics() *metrics

NewMetrics 创建新的指标实例 返回:

  • *metrics: 指标实例

func PeerInfoIDs

func PeerInfoIDs(pis []peer.AddrInfo) peer.IDSlice

PeerInfoIDs 从地址信息列表中提取对等节点ID列表 参数:

  • pis: 对等节点地址信息列表

返回:

  • peer.IDSlice: 对等节点ID切片

func PeerInfos

func PeerInfos(ps pstore.Peerstore, peers peer.IDSlice) []peer.AddrInfo

PeerInfos 获取对等节点的地址信息列表 参数:

  • ps: 对等节点存储接口
  • peers: 对等节点ID切片

返回:

  • []peer.AddrInfo: 对等节点地址信息列表

Types

This section is empty.

Directories

Path Synopsis
已弃用: 基于数据库的 peerstore 将在未来从 go-dep2p 中移除。
已弃用: 基于数据库的 peerstore 将在未来从 go-dep2p 中移除。
pb

Jump to

Keyboard shortcuts

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