@cryptotaxi247 / kubo / commits / 1f4d8c724

migrate to go-libp2p-core.

This commit was moved from ipfs/interface-go-ipfs-core@2cc0c497f2b0b14a4ac22989a3861c1a2b0038c4 This commit was moved from ipfs/boxo@1f2b5ca04f4cb9d5fe9b11d4c58edb91bab8b2a1

Raúl Kripalani committed May 28, 2019 at 17:09 UTC 1f4d8c7243039855f5c62f043168815d057777f2
4 files changed +11 -12
core/coreiface/dht.go
+3 -4
@@ -6,8 +6,7 @@ import (
6
7 "github.com/ipfs/interface-go-ipfs-core/options"
8
9 - "github.com/libp2p/go-libp2p-peer"
10 - pstore "github.com/libp2p/go-libp2p-peerstore"
9 + "github.com/libp2p/go-libp2p-core/peer"
10 )
11
12 // DhtAPI specifies the interface to the DHT
@@ -16,11 +15,11 @@ import (
15 type DhtAPI interface {
16 // FindPeer queries the DHT for all of the multiaddresses associated with a
17 // Peer ID
19 - FindPeer(context.Context, peer.ID) (pstore.PeerInfo, error)
18 + FindPeer(context.Context, peer.ID) (peer.AddrInfo, error)
19
20 // FindProviders finds peers in the DHT who can provide a specific value
21 // 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)
23
24 // Provide announces to the network that you are providing given values
25 Provide(context.Context, path.Path, ...options.DhtProvideOption) error
core/coreiface/key.go
+1 -1
@@ -6,7 +6,7 @@ import (
6
7 "github.com/ipfs/interface-go-ipfs-core/options"
8
9 - "github.com/libp2p/go-libp2p-peer"
9 + "github.com/libp2p/go-libp2p-core/peer"
10 )
11
12 // Key specifies the interface to Keys in KeyAPI Keystore
core/coreiface/pubsub.go
+1 -1
@@ -6,7 +6,7 @@ import (
6
7 options "github.com/ipfs/interface-go-ipfs-core/options"
8
9 - peer "github.com/libp2p/go-libp2p-peer"
9 + "github.com/libp2p/go-libp2p-core/peer"
10 )
11
12 // PubSubSubscription is an active PubSub subscription
core/coreiface/swarm.go
+6 -6
@@ -5,10 +5,10 @@ import (
5 "errors"
6 "time"
7
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 +
12 ma "github.com/multiformats/go-multiaddr"
13 )
14
@@ -26,7 +26,7 @@ type ConnectionInfo interface {
26 Address() ma.Multiaddr
27
28 // Direction returns which way the connection was established
29 - Direction() net.Direction
29 + Direction() network.Direction
30
31 // Latency returns last known round trip time to the peer
32 Latency() (time.Duration, error)
@@ -38,7 +38,7 @@ type ConnectionInfo interface {
38 // SwarmAPI specifies the interface to libp2p swarm
39 type SwarmAPI interface {
40 // Connect to a given peer
41 - Connect(context.Context, pstore.PeerInfo) error
41 + Connect(context.Context, peer.AddrInfo) error
42
43 // Disconnect from a given address
44 Disconnect(context.Context, ma.Multiaddr) error