go-libp2p-peerstore/pstoreds/metadata.go

21 lines
763 B
Go
Raw Normal View History

package pstoreds
import (
"context"
2022-08-18 20:53:06 +08:00
pstore "github.com/libp2p/go-libp2p/core/peerstore"
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoreds"
2021-10-23 20:31:58 +08:00
ds "github.com/ipfs/go-datastore"
)
// NewPeerMetadata creates a metadata store backed by a persistent db. It uses gob for serialisation.
//
// See `init()` to learn which types are registered by default. Modules wishing to store
// values of other types will need to `gob.Register()` them explicitly, or else callers
// will receive runtime errors.
2022-08-18 20:53:06 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoreds.NewPeerMetadata instead
func NewPeerMetadata(ctx context.Context, store ds.Datastore, opts Options) (pstore.PeerMetadata, error) {
return pstoreds.NewPeerMetadata(ctx, store, opts)
2021-10-23 20:31:58 +08:00
}