go-libp2p-peerstore/pstoremem/peerstore.go

12 lines
267 B
Go
Raw Normal View History

2018-09-05 01:07:44 +08:00
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())
}