pstoremanager

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*PeerstoreManager) error

Option 定义配置选项函数类型

func WithCleanupInterval

func WithCleanupInterval(t time.Duration) Option

WithCleanupInterval 设置清理间隔 参数:

  • t: 清理间隔时长

返回:

  • Option: 配置选项函数

func WithGracePeriod

func WithGracePeriod(p time.Duration) Option

WithGracePeriod 设置宽限期 参数:

  • p: 宽限期时长

返回:

  • Option: 配置选项函数

type PeerstoreManager

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

PeerstoreManager 对等节点存储管理器结构体

func NewPeerstoreManager

func NewPeerstoreManager(pstore peerstore.Peerstore, eventBus event.Bus, network network.Network, opts ...Option) (*PeerstoreManager, error)

NewPeerstoreManager 创建新的对等节点存储管理器 参数:

  • pstore: 对等节点存储
  • eventBus: 事件总线
  • network: 网络接口
  • opts: 配置选项

返回:

  • *PeerstoreManager: 管理器实例
  • error: 错误信息

func (*PeerstoreManager) Close

func (m *PeerstoreManager) Close() error

Close 关闭对等节点存储管理器 返回:

  • error: 错误信息

func (*PeerstoreManager) Start

func (m *PeerstoreManager) Start()

Start 启动对等节点存储管理器

Jump to

Keyboard shortcuts

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