pstoremanager

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 8 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

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, opts ...Option) (*PeerstoreManager, error)

func (*PeerstoreManager) Close

func (m *PeerstoreManager) Close() error

func (*PeerstoreManager) Start

func (m *PeerstoreManager) Start()

Jump to

Keyboard shortcuts

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