mirror of
https://github.com/libp2p/go-libp2p-peerstore.git
synced 2025-01-04 00:50:12 +08:00
12 lines
266 B
Go
12 lines
266 B
Go
|
package mem
|
||
|
|
||
|
import pstore "github.com/libp2p/go-libp2p-peerstore"
|
||
|
|
||
|
// NewPeerstore creates an in-memory threadsafe collection of peers.
|
||
|
func NewPeerstore() pstore.Peerstore {
|
||
|
return pstore.NewPeerstoreWith(
|
||
|
NewKeybook(),
|
||
|
&AddrManager{},
|
||
|
NewPeerMetadata())
|
||
|
}
|