Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
cea1fe13
Commit
cea1fe13
authored
Oct 04, 2016
by
Jeromy
Browse files
extract net interface and metrics
parent
3d31b833
Changes
38
Hide whitespace changes
Inline
Side-by-side
p2p/net/mock/mock_test.go
View file @
cea1fe13
...
@@ -10,7 +10,7 @@ import (
...
@@ -10,7 +10,7 @@ import (
"testing"
"testing"
"time"
"time"
inet
"github.com/libp2p/go-libp2p
/p2p/
net"
inet
"github.com/libp2p/go-libp2p
-
net"
peer
"github.com/ipfs/go-libp2p-peer"
peer
"github.com/ipfs/go-libp2p-peer"
detectrace
"github.com/jbenet/go-detect-race"
detectrace
"github.com/jbenet/go-detect-race"
...
...
p2p/net/swarm/swarm.go
View file @
cea1fe13
...
@@ -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"
...
...
p2p/net/swarm/swarm_addr_test.go
View file @
cea1fe13
...
@@ -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"
)
)
...
...
p2p/net/swarm/swarm_conn.go
View file @
cea1fe13
...
@@ -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"
...
...
p2p/net/swarm/swarm_listen.go
View file @
cea1fe13
...
@@ -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
{
...
...
p2p/net/swarm/swarm_net.go
View file @
cea1fe13
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.
...
...
p2p/net/swarm/swarm_net_test.go
View file @
cea1fe13
...
@@ -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
...
...
p2p/net/swarm/swarm_notif_test.go
View file @
cea1fe13
...
@@ -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
{
...
...
p2p/net/swarm/swarm_stream.go
View file @
cea1fe13
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"
)
)
...
...
p2p/net/swarm/swarm_test.go
View file @
cea1fe13
...
@@ -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"
)
)
...
...
p2p/protocol/identify/id.go
View file @
cea1fe13
...
@@ -5,20 +5,20 @@ import (
...
@@ -5,20 +5,20 @@ import (
"strings"
"strings"
"sync"
"sync"
host
"github.com/libp2p/go-libp2p/p2p/host"
pb
"github.com/libp2p/go-libp2p/p2p/protocol/identify/pb"
semver
"github.com/coreos/go-semver/semver"
semver
"github.com/coreos/go-semver/semver"
ggio
"github.com/gogo/protobuf/io"
ggio
"github.com/gogo/protobuf/io"
ic
"github.com/ipfs/go-libp2p-crypto"
ic
"github.com/ipfs/go-libp2p-crypto"
lgbl
"github.com/ipfs/go-libp2p-loggables"
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"
logging
"github.com/ipfs/go-log"
ma
"github.com/jbenet/go-multiaddr"
ma
"github.com/jbenet/go-multiaddr"
host
"github.com/libp2p/go-libp2p/p2p/host"
mstream
"github.com/libp2p/go-libp2p-metrics/stream"
mstream
"github.com/libp2p/go-libp2p/p2p/metrics/stream"
inet
"github.com/libp2p/go-libp2p-net"
inet
"github.com/libp2p/go-libp2p/p2p/net"
pb
"github.com/libp2p/go-libp2p/p2p/protocol/identify/pb"
msmux
"github.com/whyrusleeping/go-multistream"
msmux
"github.com/whyrusleeping/go-multistream"
lgbl
"github.com/ipfs/go-libp2p-loggables"
logging
"github.com/ipfs/go-log"
)
)
var
log
=
logging
.
Logger
(
"net/identify"
)
var
log
=
logging
.
Logger
(
"net/identify"
)
...
...
p2p/protocol/ping/ping.go
View file @
cea1fe13
...
@@ -10,8 +10,8 @@ import (
...
@@ -10,8 +10,8 @@ import (
u
"github.com/ipfs/go-ipfs-util"
u
"github.com/ipfs/go-ipfs-util"
peer
"github.com/ipfs/go-libp2p-peer"
peer
"github.com/ipfs/go-libp2p-peer"
logging
"github.com/ipfs/go-log"
logging
"github.com/ipfs/go-log"
inet
"github.com/libp2p/go-libp2p-net"
host
"github.com/libp2p/go-libp2p/p2p/host"
host
"github.com/libp2p/go-libp2p/p2p/host"
inet
"github.com/libp2p/go-libp2p/p2p/net"
)
)
var
log
=
logging
.
Logger
(
"ping"
)
var
log
=
logging
.
Logger
(
"ping"
)
...
...
p2p/protocol/relay/relay.go
View file @
cea1fe13
package
relay
package
relay
import
(
import
(
"context"
"fmt"
"fmt"
"io"
"io"
"time"
"time"
"context"
host
"github.com/libp2p/go-libp2p/p2p/host"
peer
"github.com/ipfs/go-libp2p-peer"
peer
"github.com/ipfs/go-libp2p-peer"
logging
"github.com/ipfs/go-log"
logging
"github.com/ipfs/go-log"
mh
"github.com/jbenet/go-multihash"
mh
"github.com/jbenet/go-multihash"
inet
"github.com/libp2p/go-libp2p-net"
protocol
"github.com/libp2p/go-libp2p-protocol"
protocol
"github.com/libp2p/go-libp2p-protocol"
host
"github.com/libp2p/go-libp2p/p2p/host"
inet
"github.com/libp2p/go-libp2p/p2p/net"
)
)
var
log
=
logging
.
Logger
(
"
github.com/libp2p/go-libp2p/p2p/
protocol/relay"
)
var
log
=
logging
.
Logger
(
"protocol/relay"
)
// ID is the protocol.ID of the Relay Service.
// ID is the protocol.ID of the Relay Service.
const
ID
protocol
.
ID
=
"/ipfs/relay/line/0.1.0"
const
ID
protocol
.
ID
=
"/ipfs/relay/line/0.1.0"
...
...
p2p/protocol/relay/relay_test.go
View file @
cea1fe13
...
@@ -6,8 +6,8 @@ import (
...
@@ -6,8 +6,8 @@ import (
"context"
"context"
logging
"github.com/ipfs/go-log"
logging
"github.com/ipfs/go-log"
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"
relay
"github.com/libp2p/go-libp2p/p2p/protocol/relay"
relay
"github.com/libp2p/go-libp2p/p2p/protocol/relay"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
msmux
"github.com/whyrusleeping/go-multistream"
msmux
"github.com/whyrusleeping/go-multistream"
...
...
p2p/test/backpressure/backpressure_test.go
View file @
cea1fe13
...
@@ -10,9 +10,9 @@ import (
...
@@ -10,9 +10,9 @@ import (
u
"github.com/ipfs/go-ipfs-util"
u
"github.com/ipfs/go-ipfs-util"
peer
"github.com/ipfs/go-libp2p-peer"
peer
"github.com/ipfs/go-libp2p-peer"
logging
"github.com/ipfs/go-log"
logging
"github.com/ipfs/go-log"
inet
"github.com/libp2p/go-libp2p-net"
protocol
"github.com/libp2p/go-libp2p-protocol"
protocol
"github.com/libp2p/go-libp2p-protocol"
host
"github.com/libp2p/go-libp2p/p2p/host"
host
"github.com/libp2p/go-libp2p/p2p/host"
inet
"github.com/libp2p/go-libp2p/p2p/net"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
)
)
...
...
p2p/test/reconnects/reconnect_test.go
View file @
cea1fe13
...
@@ -11,9 +11,9 @@ import (
...
@@ -11,9 +11,9 @@ import (
u
"github.com/ipfs/go-ipfs-util"
u
"github.com/ipfs/go-ipfs-util"
logging
"github.com/ipfs/go-log"
logging
"github.com/ipfs/go-log"
ps
"github.com/jbenet/go-peerstream"
ps
"github.com/jbenet/go-peerstream"
inet
"github.com/libp2p/go-libp2p-net"
protocol
"github.com/libp2p/go-libp2p-protocol"
protocol
"github.com/libp2p/go-libp2p-protocol"
host
"github.com/libp2p/go-libp2p/p2p/host"
host
"github.com/libp2p/go-libp2p/p2p/host"
inet
"github.com/libp2p/go-libp2p/p2p/net"
swarm
"github.com/libp2p/go-libp2p/p2p/net/swarm"
swarm
"github.com/libp2p/go-libp2p/p2p/net/swarm"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
)
)
...
...
p2p/test/util/util.go
View file @
cea1fe13
...
@@ -5,12 +5,12 @@ import (
...
@@ -5,12 +5,12 @@ import (
"testing"
"testing"
bhost
"github.com/libp2p/go-libp2p/p2p/host/basic"
bhost
"github.com/libp2p/go-libp2p/p2p/host/basic"
metrics
"github.com/libp2p/go-libp2p/p2p/metrics"
inet
"github.com/libp2p/go-libp2p/p2p/net"
swarm
"github.com/libp2p/go-libp2p/p2p/net/swarm"
swarm
"github.com/libp2p/go-libp2p/p2p/net/swarm"
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"
tu
"github.com/libp2p/go-testutil"
tu
"github.com/libp2p/go-testutil"
)
)
...
...
package.json
View file @
cea1fe13
...
@@ -218,6 +218,18 @@
...
@@ -218,6 +218,18 @@
"hash"
:
"QmTaW4q1AbqMkpfDLUYzW18nW62GsrnFvtVcvR1pnaURm6"
,
"hash"
:
"QmTaW4q1AbqMkpfDLUYzW18nW62GsrnFvtVcvR1pnaURm6"
,
"name"
:
"go-libp2p-conn"
,
"name"
:
"go-libp2p-conn"
,
"version"
:
"1.0.0"
"version"
:
"1.0.0"
},
{
"author"
:
"whyrusleeping"
,
"hash"
:
"QmSctCnUNkE7c7C2LGRGYrdmU9SDH3MtbAeueN7Jq1NN2q"
,
"name"
:
"go-libp2p-net"
,
"version"
:
"1.0.0"
},
{
"author"
:
"whyrusleeping"
,
"hash"
:
"QmS38TTyj47fP5NVNznxpw4KpFYSU9zHkCEfmuBSkHzb6d"
,
"name"
:
"go-libp2p-metrics"
,
"version"
:
"1.0.0"
}
}
],
],
"gxVersion"
:
"0.4.0"
,
"gxVersion"
:
"0.4.0"
,
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment