package pstoremem

Import Path
	github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem (on go.dev)

Dependency Relation
	imports 19 packages, and imported by 3 packages


Package-Level Type Names (total 4)
/* sort by: | */
func WithClock(clock clock) AddrBookOption func WithMaxAddresses(n int) AddrBookOption func WithMaxSignedPeerRecords(n int) AddrBookOption func NewAddrBook(opts ...AddrBookOption) *memoryAddrBook
An abstracted, pub-sub manager for address streams. Extracted from memoryAddrBook in order to support additional implementations. AddrStream creates a new subscription for a given peer ID, pre-populating the channel with any addresses we might already have on file. BroadcastAddr broadcasts a new address to all subscribed streams. func NewAddrSubManager() *AddrSubManager
func NewPeerstore(opts ...Option) (ps *pstoremem, err error)
func WithMaxProtocols(num int) ProtoBookOption func NewProtoBook(opts ...ProtoBookOption) (*memoryProtoBook, error)
Package-Level Functions (total 10)
NewAddrSubManager initializes an AddrSubManager.
NewPeerstore creates an in-memory thread-safe collection of peers. It's the caller's responsibility to call RemovePeer to ensure that memory consumption of the peerstore doesn't grow unboundedly.
WithMaxAddresses sets the maximum number of unconnected addresses to store. The maximum number of connected addresses is bounded by the connection limits in the Connection Manager and Resource Manager.