remove deprecated types
This commit is contained in:
parent
9c9ee541cb
commit
4e1ef58c54
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue