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)
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)
func NewAddrBook(opts ...AddrBookOption) *memoryAddrBook
NewAddrSubManager initializes an AddrSubManager.
func NewKeyBook() *memoryKeyBook func NewPeerMetadata() *memoryPeerMetadata
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.
func NewProtoBook(opts ...ProtoBookOption) (*memoryProtoBook, error) func WithClock(clock clock) AddrBookOption
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.
func WithMaxProtocols(num int) ProtoBookOption![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |