remove deprecated types

This commit is contained in:
Marten Seemann 2021-07-22 21:15:16 +02:00
parent 9c9ee541cb
commit 4e1ef58c54
2 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ import (
"github.com/libp2p/go-libp2p-core/discovery"
"time"
cid "github.com/ipfs/go-cid"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"
@ -23,8 +23,8 @@ func NewRoutingDiscovery(router routing.ContentRouting) *RoutingDiscovery {
return &RoutingDiscovery{router}
}
func (d *RoutingDiscovery) Advertise(ctx context.Context, ns string, opts ...Option) (time.Duration, error) {
var options Options
func (d *RoutingDiscovery) Advertise(ctx context.Context, ns string, opts ...discovery.Option) (time.Duration, error) {
var options discovery.Options
err := options.Apply(opts...)
if err != nil {
return 0, err
@ -56,8 +56,8 @@ func (d *RoutingDiscovery) Advertise(ctx context.Context, ns string, opts ...Opt
return ttl, nil
}
func (d *RoutingDiscovery) FindPeers(ctx context.Context, ns string, opts ...Option) (<-chan peer.AddrInfo, error) {
var options Options
func (d *RoutingDiscovery) FindPeers(ctx context.Context, ns string, opts ...discovery.Option) (<-chan peer.AddrInfo, error) {
var options discovery.Options
err := options.Apply(opts...)
if err != nil {
return nil, err

View File

@ -90,7 +90,7 @@ func TestRoutingDiscovery(t *testing.T) {
t.Fatal(err)
}
pis, err := FindPeers(ctx, d2, "/test", Limit(20))
pis, err := FindPeers(ctx, d2, "/test", discovery.Limit(20))
if err != nil {
t.Fatal(err)
}