Skip to content

Commit

Permalink
Merge pull request ipfs/interface-go-ipfs-core#35 from raulk/migrate-…
Browse files Browse the repository at this point in the history
…libp2p

migrate to go-libp2p-core.

This commit was moved from ipfs/interface-go-ipfs-core@f77aa7e
  • Loading branch information
Stebalien authored May 31, 2019
2 parents babb7c8 + e7b0073 commit 0bdbe86
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
7 changes: 3 additions & 4 deletions coreapi/iface/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (

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

"github.com/libp2p/go-libp2p-peer"
pstore "github.com/libp2p/go-libp2p-peerstore"
"github.com/libp2p/go-libp2p-core/peer"
)

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

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

// Provide announces to the network that you are providing given values
Provide(context.Context, path.Path, ...options.DhtProvideOption) error
Expand Down
2 changes: 1 addition & 1 deletion coreapi/iface/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

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

"github.com/libp2p/go-libp2p-peer"
"github.com/libp2p/go-libp2p-core/peer"
)

// Key specifies the interface to Keys in KeyAPI Keystore
Expand Down
2 changes: 1 addition & 1 deletion coreapi/iface/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

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

peer "github.com/libp2p/go-libp2p-peer"
"github.com/libp2p/go-libp2p-core/peer"
)

// PubSubSubscription is an active PubSub subscription
Expand Down
12 changes: 6 additions & 6 deletions coreapi/iface/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"errors"
"time"

net "github.com/libp2p/go-libp2p-net"
"github.com/libp2p/go-libp2p-peer"
pstore "github.com/libp2p/go-libp2p-peerstore"
"github.com/libp2p/go-libp2p-protocol"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"

ma "github.com/multiformats/go-multiaddr"
)

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

// Direction returns which way the connection was established
Direction() net.Direction
Direction() network.Direction

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

// Disconnect from a given address
Disconnect(context.Context, ma.Multiaddr) error
Expand Down

0 comments on commit 0bdbe86

Please sign in to comment.