Commit 22b1351f authored by Jeromy's avatar Jeromy

extract net interface and metrics

parent 4f68cf39
...@@ -11,10 +11,6 @@ import ( ...@@ -11,10 +11,6 @@ import (
"sync" "sync"
"time" "time"
metrics "github.com/libp2p/go-libp2p/p2p/metrics"
mconn "github.com/libp2p/go-libp2p/p2p/metrics/conn"
inet "github.com/libp2p/go-libp2p/p2p/net"
ci "github.com/ipfs/go-libp2p-crypto" ci "github.com/ipfs/go-libp2p-crypto"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore" pstore "github.com/ipfs/go-libp2p-peerstore"
...@@ -26,6 +22,9 @@ import ( ...@@ -26,6 +22,9 @@ import (
goprocessctx "github.com/jbenet/goprocess/context" goprocessctx "github.com/jbenet/goprocess/context"
addrutil "github.com/libp2p/go-addr-util" addrutil "github.com/libp2p/go-addr-util"
conn "github.com/libp2p/go-libp2p-conn" conn "github.com/libp2p/go-libp2p-conn"
metrics "github.com/libp2p/go-libp2p-metrics"
mconn "github.com/libp2p/go-libp2p-metrics/conn"
inet "github.com/libp2p/go-libp2p-net"
transport "github.com/libp2p/go-libp2p-transport" transport "github.com/libp2p/go-libp2p-transport"
filter "github.com/libp2p/go-maddr-filter" filter "github.com/libp2p/go-maddr-filter"
tcpt "github.com/libp2p/go-tcp-transport" tcpt "github.com/libp2p/go-tcp-transport"
......
...@@ -4,11 +4,10 @@ import ( ...@@ -4,11 +4,10 @@ import (
"context" "context"
"testing" "testing"
metrics "github.com/libp2p/go-libp2p/p2p/metrics"
pstore "github.com/ipfs/go-libp2p-peerstore" pstore "github.com/ipfs/go-libp2p-peerstore"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
addrutil "github.com/libp2p/go-addr-util" addrutil "github.com/libp2p/go-addr-util"
metrics "github.com/libp2p/go-libp2p-metrics"
testutil "github.com/libp2p/go-testutil" testutil "github.com/libp2p/go-testutil"
) )
......
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
inet "github.com/libp2p/go-libp2p/p2p/net" inet "github.com/libp2p/go-libp2p-net"
ic "github.com/ipfs/go-libp2p-crypto" ic "github.com/ipfs/go-libp2p-crypto"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
......
...@@ -4,14 +4,13 @@ import ( ...@@ -4,14 +4,13 @@ import (
"context" "context"
"fmt" "fmt"
inet "github.com/libp2p/go-libp2p/p2p/net"
lgbl "github.com/ipfs/go-libp2p-loggables" lgbl "github.com/ipfs/go-libp2p-loggables"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
ps "github.com/jbenet/go-peerstream" ps "github.com/jbenet/go-peerstream"
conn "github.com/libp2p/go-libp2p-conn" conn "github.com/libp2p/go-libp2p-conn"
mconn "github.com/libp2p/go-libp2p-metrics/conn"
inet "github.com/libp2p/go-libp2p-net"
transport "github.com/libp2p/go-libp2p-transport" transport "github.com/libp2p/go-libp2p-transport"
mconn "github.com/libp2p/go-libp2p/p2p/metrics/conn"
) )
func (s *Swarm) AddListenAddr(a ma.Multiaddr) error { func (s *Swarm) AddListenAddr(a ma.Multiaddr) error {
......
package swarm package swarm
import ( import (
"context"
"fmt" "fmt"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore" pstore "github.com/ipfs/go-libp2p-peerstore"
metrics "github.com/libp2p/go-libp2p/p2p/metrics"
inet "github.com/libp2p/go-libp2p/p2p/net"
"context"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
"github.com/jbenet/goprocess" "github.com/jbenet/goprocess"
metrics "github.com/libp2p/go-libp2p-metrics"
inet "github.com/libp2p/go-libp2p-net"
) )
// Network implements the inet.Network interface. // Network implements the inet.Network interface.
......
...@@ -5,9 +5,9 @@ import ( ...@@ -5,9 +5,9 @@ import (
"testing" "testing"
"time" "time"
inet "github.com/libp2p/go-libp2p/p2p/net"
testutil "github.com/libp2p/go-libp2p/p2p/test/util"
"context" "context"
inet "github.com/libp2p/go-libp2p-net"
testutil "github.com/libp2p/go-libp2p/p2p/test/util"
) )
// TestConnectednessCorrect starts a few networks, connects a few // TestConnectednessCorrect starts a few networks, connects a few
......
...@@ -7,7 +7,7 @@ import ( ...@@ -7,7 +7,7 @@ import (
"context" "context"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
inet "github.com/libp2p/go-libp2p/p2p/net" inet "github.com/libp2p/go-libp2p-net"
) )
func streamsSame(a, b inet.Stream) bool { func streamsSame(a, b inet.Stream) bool {
......
package swarm package swarm
import ( import (
inet "github.com/libp2p/go-libp2p-net"
protocol "github.com/libp2p/go-libp2p-protocol" protocol "github.com/libp2p/go-libp2p-protocol"
inet "github.com/libp2p/go-libp2p/p2p/net"
ps "github.com/jbenet/go-peerstream" ps "github.com/jbenet/go-peerstream"
) )
......
...@@ -10,12 +10,11 @@ import ( ...@@ -10,12 +10,11 @@ import (
"testing" "testing"
"time" "time"
metrics "github.com/libp2p/go-libp2p/p2p/metrics"
inet "github.com/libp2p/go-libp2p/p2p/net"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore" pstore "github.com/ipfs/go-libp2p-peerstore"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
metrics "github.com/libp2p/go-libp2p-metrics"
inet "github.com/libp2p/go-libp2p-net"
testutil "github.com/libp2p/go-testutil" testutil "github.com/libp2p/go-testutil"
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment