mirror of
https://github.com/libp2p/go-libp2p-peerstore.git
synced 2024-12-28 23:50:12 +08:00
12 lines
267 B
Go
12 lines
267 B
Go
package pstoremem
|
|
|
|
import pstore "github.com/libp2p/go-libp2p-peerstore"
|
|
|
|
// NewPeerstore creates an in-memory threadsafe collection of peers.
|
|
func NewPeerstore() pstore.Peerstore {
|
|
return pstore.NewPeerstore(
|
|
NewKeyBook(),
|
|
NewAddrBook(),
|
|
NewPeerMetadata())
|
|
}
|