package pstoremanager

import "github.com/libp2p/go-libp2p/p2p/host/pstoremanager"

Index

Types

type Option

type Option func(*PeerstoreManager) error

func WithCleanupInterval

func WithCleanupInterval(t time.Duration) Option

WithCleanupInterval set the clean up interval. During a clean up run peers that disconnected before the grace period are removed. If unset, the interval is set to half the grace period.

func WithGracePeriod

func WithGracePeriod(p time.Duration) Option

WithGracePeriod sets the grace period. If a peer doesn't reconnect during the grace period, its data is removed. Default: 1 minute.

type PeerstoreManager

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

func NewPeerstoreManager

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

func (*PeerstoreManager) Close

func (m *PeerstoreManager) Close() error

func (*PeerstoreManager) Start

func (m *PeerstoreManager) Start()

Source Files

pstoremanager.go

Version
v0.42.0 (latest)
Published
Jun 18, 2025
Platform
linux/amd64
Imports
9 packages
Last checked
4 weeks ago

Tools for package owners.