Skip to content

Commit 60f7fae

Browse files
authored
Merge pull request ipfs/interface-go-ipfs-core#35 from raulk/migrate-libp2p
migrate to go-libp2p-core. This commit was moved from ipfs/interface-go-ipfs-core@f77aa7e
2 parents b28c302 + 1f2b5ca commit 60f7fae

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

coreiface/dht.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import (
66

77
"github.com/ipfs/interface-go-ipfs-core/options"
88

9-
"github.com/libp2p/go-libp2p-peer"
10-
pstore "github.com/libp2p/go-libp2p-peerstore"
9+
"github.com/libp2p/go-libp2p-core/peer"
1110
)
1211

1312
// DhtAPI specifies the interface to the DHT
@@ -16,11 +15,11 @@ import (
1615
type DhtAPI interface {
1716
// FindPeer queries the DHT for all of the multiaddresses associated with a
1817
// Peer ID
19-
FindPeer(context.Context, peer.ID) (pstore.PeerInfo, error)
18+
FindPeer(context.Context, peer.ID) (peer.AddrInfo, error)
2019

2120
// FindProviders finds peers in the DHT who can provide a specific value
2221
// given a key.
23-
FindProviders(context.Context, path.Path, ...options.DhtFindProvidersOption) (<-chan pstore.PeerInfo, error)
22+
FindProviders(context.Context, path.Path, ...options.DhtFindProvidersOption) (<-chan peer.AddrInfo, error)
2423

2524
// Provide announces to the network that you are providing given values
2625
Provide(context.Context, path.Path, ...options.DhtProvideOption) error

coreiface/key.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
"github.com/ipfs/interface-go-ipfs-core/options"
88

9-
"github.com/libp2p/go-libp2p-peer"
9+
"github.com/libp2p/go-libp2p-core/peer"
1010
)
1111

1212
// Key specifies the interface to Keys in KeyAPI Keystore

coreiface/pubsub.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
options "github.com/ipfs/interface-go-ipfs-core/options"
88

9-
peer "github.com/libp2p/go-libp2p-peer"
9+
"github.com/libp2p/go-libp2p-core/peer"
1010
)
1111

1212
// PubSubSubscription is an active PubSub subscription

coreiface/swarm.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"errors"
66
"time"
77

8-
net "github.com/libp2p/go-libp2p-net"
9-
"github.com/libp2p/go-libp2p-peer"
10-
pstore "github.com/libp2p/go-libp2p-peerstore"
11-
"github.com/libp2p/go-libp2p-protocol"
8+
"github.com/libp2p/go-libp2p-core/network"
9+
"github.com/libp2p/go-libp2p-core/peer"
10+
"github.com/libp2p/go-libp2p-core/protocol"
11+
1212
ma "github.com/multiformats/go-multiaddr"
1313
)
1414

@@ -26,7 +26,7 @@ type ConnectionInfo interface {
2626
Address() ma.Multiaddr
2727

2828
// Direction returns which way the connection was established
29-
Direction() net.Direction
29+
Direction() network.Direction
3030

3131
// Latency returns last known round trip time to the peer
3232
Latency() (time.Duration, error)
@@ -38,7 +38,7 @@ type ConnectionInfo interface {
3838
// SwarmAPI specifies the interface to libp2p swarm
3939
type SwarmAPI interface {
4040
// Connect to a given peer
41-
Connect(context.Context, pstore.PeerInfo) error
41+
Connect(context.Context, peer.AddrInfo) error
4242

4343
// Disconnect from a given address
4444
Disconnect(context.Context, ma.Multiaddr) error

0 commit comments

Comments
 (0)