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
4dd30d82
Commit
4dd30d82
authored
Oct 03, 2016
by
Jeromy
Browse files
switch to using stdlib context package
parent
87b0e200
Changes
40
Show whitespace changes
Inline
Side-by-side
p2p/net/swarm/dial_test.go
View file @
4dd30d82
...
...
@@ -10,11 +10,11 @@ import (
testutil
"github.com/libp2p/go-libp2p/testutil"
ci
"github.com/libp2p/go-libp2p/testutil/ci"
"context"
peer
"github.com/ipfs/go-libp2p-peer"
pstore
"github.com/ipfs/go-libp2p-peerstore"
ma
"github.com/jbenet/go-multiaddr"
manet
"github.com/jbenet/go-multiaddr-net"
context
"golang.org/x/net/context"
)
func
closeSwarms
(
swarms
[]
*
Swarm
)
{
...
...
p2p/net/swarm/peers_test.go
View file @
4dd30d82
...
...
@@ -3,10 +3,10 @@ package swarm
import
(
"testing"
"context"
peer
"github.com/ipfs/go-libp2p-peer"
pstore
"github.com/ipfs/go-libp2p-peerstore"
ma
"github.com/jbenet/go-multiaddr"
context
"golang.org/x/net/context"
)
func
TestPeers
(
t
*
testing
.
T
)
{
...
...
p2p/net/swarm/simul_test.go
View file @
4dd30d82
...
...
@@ -8,10 +8,10 @@ import (
ci
"github.com/libp2p/go-libp2p/testutil/ci"
"context"
peer
"github.com/ipfs/go-libp2p-peer"
pstore
"github.com/ipfs/go-libp2p-peerstore"
ma
"github.com/jbenet/go-multiaddr"
context
"golang.org/x/net/context"
)
func
TestSimultOpen
(
t
*
testing
.
T
)
{
...
...
p2p/net/swarm/swarm_addr_test.go
View file @
4dd30d82
...
...
@@ -7,9 +7,9 @@ import (
addrutil
"github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
testutil
"github.com/libp2p/go-libp2p/testutil"
"context"
pstore
"github.com/ipfs/go-libp2p-peerstore"
ma
"github.com/jbenet/go-multiaddr"
context
"golang.org/x/net/context"
)
func
TestFilterAddrs
(
t
*
testing
.
T
)
{
...
...
p2p/net/swarm/swarm_conn.go
View file @
4dd30d82
...
...
@@ -6,11 +6,11 @@ import (
inet
"github.com/libp2p/go-libp2p/p2p/net"
conn
"github.com/libp2p/go-libp2p/p2p/net/conn"
"context"
ic
"github.com/ipfs/go-libp2p-crypto"
peer
"github.com/ipfs/go-libp2p-peer"
ma
"github.com/jbenet/go-multiaddr"
ps
"github.com/jbenet/go-peerstream"
context
"golang.org/x/net/context"
)
// Conn is a simple wrapper around a ps.Conn that also exposes
...
...
p2p/net/swarm/swarm_listen.go
View file @
4dd30d82
...
...
@@ -3,6 +3,7 @@ package swarm
import
(
"fmt"
"context"
lgbl
"github.com/ipfs/go-libp2p-loggables"
ma
"github.com/jbenet/go-multiaddr"
ps
"github.com/jbenet/go-peerstream"
...
...
@@ -10,7 +11,6 @@ import (
mconn
"github.com/libp2p/go-libp2p/p2p/metrics/conn"
inet
"github.com/libp2p/go-libp2p/p2p/net"
conn
"github.com/libp2p/go-libp2p/p2p/net/conn"
context
"golang.org/x/net/context"
)
func
(
s
*
Swarm
)
AddListenAddr
(
a
ma
.
Multiaddr
)
error
{
...
...
p2p/net/swarm/swarm_net.go
View file @
4dd30d82
...
...
@@ -8,9 +8,9 @@ import (
metrics
"github.com/libp2p/go-libp2p/p2p/metrics"
inet
"github.com/libp2p/go-libp2p/p2p/net"
"context"
ma
"github.com/jbenet/go-multiaddr"
"github.com/jbenet/goprocess"
context
"golang.org/x/net/context"
)
// Network implements the inet.Network interface.
...
...
p2p/net/swarm/swarm_net_test.go
View file @
4dd30d82
...
...
@@ -7,7 +7,7 @@ import (
inet
"github.com/libp2p/go-libp2p/p2p/net"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
context
"golang.org/x/net/
context"
"
context"
)
// TestConnectednessCorrect starts a few networks, connects a few
...
...
p2p/net/swarm/swarm_notif_test.go
View file @
4dd30d82
...
...
@@ -4,10 +4,10 @@ import (
"testing"
"time"
"context"
peer
"github.com/ipfs/go-libp2p-peer"
ma
"github.com/jbenet/go-multiaddr"
inet
"github.com/libp2p/go-libp2p/p2p/net"
context
"golang.org/x/net/context"
)
func
streamsSame
(
a
,
b
inet
.
Stream
)
bool
{
...
...
p2p/net/swarm/swarm_test.go
View file @
4dd30d82
...
...
@@ -13,10 +13,10 @@ import (
inet
"github.com/libp2p/go-libp2p/p2p/net"
testutil
"github.com/libp2p/go-libp2p/testutil"
"context"
peer
"github.com/ipfs/go-libp2p-peer"
pstore
"github.com/ipfs/go-libp2p-peerstore"
ma
"github.com/jbenet/go-multiaddr"
context
"golang.org/x/net/context"
)
func
EchoStreamHandler
(
stream
inet
.
Stream
)
{
...
...
p2p/protocol/identify/id.go
View file @
4dd30d82
package
identify
import
(
"context"
"strings"
"sync"
...
...
@@ -15,7 +16,6 @@ import (
inet
"github.com/libp2p/go-libp2p/p2p/net"
pb
"github.com/libp2p/go-libp2p/p2p/protocol/identify/pb"
msmux
"github.com/whyrusleeping/go-multistream"
context
"golang.org/x/net/context"
lgbl
"github.com/ipfs/go-libp2p-loggables"
logging
"github.com/ipfs/go-log"
...
...
p2p/protocol/identify/id_test.go
View file @
4dd30d82
...
...
@@ -10,8 +10,8 @@ import (
identify
"github.com/libp2p/go-libp2p/p2p/protocol/identify"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
"context"
ma
"github.com/jbenet/go-multiaddr"
context
"golang.org/x/net/context"
)
func
subtestIDService
(
t
*
testing
.
T
,
postDialWait
time
.
Duration
)
{
...
...
p2p/protocol/ping/ping.go
View file @
4dd30d82
...
...
@@ -2,6 +2,7 @@ package ping
import
(
"bytes"
"context"
"errors"
"io"
"time"
...
...
@@ -11,7 +12,6 @@ import (
logging
"github.com/ipfs/go-log"
host
"github.com/libp2p/go-libp2p/p2p/host"
inet
"github.com/libp2p/go-libp2p/p2p/net"
context
"golang.org/x/net/context"
)
var
log
=
logging
.
Logger
(
"ping"
)
...
...
p2p/protocol/ping/ping_test.go
View file @
4dd30d82
...
...
@@ -6,9 +6,9 @@ import (
netutil
"github.com/libp2p/go-libp2p/p2p/test/util"
"context"
peer
"github.com/ipfs/go-libp2p-peer"
pstore
"github.com/ipfs/go-libp2p-peerstore"
context
"golang.org/x/net/context"
)
func
TestPing
(
t
*
testing
.
T
)
{
...
...
p2p/protocol/relay/relay.go
View file @
4dd30d82
...
...
@@ -5,13 +5,13 @@ import (
"io"
"time"
"context"
peer
"github.com/ipfs/go-libp2p-peer"
logging
"github.com/ipfs/go-log"
mh
"github.com/jbenet/go-multihash"
host
"github.com/libp2p/go-libp2p/p2p/host"
inet
"github.com/libp2p/go-libp2p/p2p/net"
protocol
"github.com/libp2p/go-libp2p/p2p/protocol"
context
"golang.org/x/net/context"
)
var
log
=
logging
.
Logger
(
"github.com/libp2p/go-libp2p/p2p/protocol/relay"
)
...
...
p2p/protocol/relay/relay_test.go
View file @
4dd30d82
...
...
@@ -4,13 +4,13 @@ import (
"io"
"testing"
"context"
logging
"github.com/ipfs/go-log"
inet
"github.com/libp2p/go-libp2p/p2p/net"
protocol
"github.com/libp2p/go-libp2p/p2p/protocol"
relay
"github.com/libp2p/go-libp2p/p2p/protocol/relay"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
msmux
"github.com/whyrusleeping/go-multistream"
context
"golang.org/x/net/context"
)
var
log
=
logging
.
Logger
(
"relay_test"
)
...
...
p2p/test/backpressure/backpressure_test.go
View file @
4dd30d82
...
...
@@ -6,6 +6,7 @@ import (
"testing"
"time"
"context"
u
"github.com/ipfs/go-ipfs-util"
peer
"github.com/ipfs/go-libp2p-peer"
logging
"github.com/ipfs/go-log"
...
...
@@ -13,7 +14,6 @@ import (
inet
"github.com/libp2p/go-libp2p/p2p/net"
protocol
"github.com/libp2p/go-libp2p/p2p/protocol"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
context
"golang.org/x/net/context"
)
var
log
=
logging
.
Logger
(
"backpressure"
)
...
...
p2p/test/reconnects/reconnect_test.go
View file @
4dd30d82
package
reconnect
import
(
"context"
"io"
"math/rand"
"sync"
...
...
@@ -15,7 +16,6 @@ import (
swarm
"github.com/libp2p/go-libp2p/p2p/net/swarm"
protocol
"github.com/libp2p/go-libp2p/p2p/protocol"
testutil
"github.com/libp2p/go-libp2p/p2p/test/util"
context
"golang.org/x/net/context"
)
func
init
()
{
...
...
p2p/test/util/util.go
View file @
4dd30d82
...
...
@@ -10,8 +10,8 @@ import (
swarm
"github.com/libp2p/go-libp2p/p2p/net/swarm"
tu
"github.com/libp2p/go-libp2p/testutil"
"context"
ma
"github.com/jbenet/go-multiaddr"
context
"golang.org/x/net/context"
)
func
GenSwarmNetwork
(
t
*
testing
.
T
,
ctx
context
.
Context
)
*
swarm
.
Network
{
...
...
package.json
View file @
4dd30d82
...
...
@@ -103,11 +103,6 @@
"name"
:
"randbo"
,
"version"
:
"0.0.0"
},
{
"hash"
:
"QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt"
,
"name"
:
"go-net"
,
"version"
:
"0.0.0"
},
{
"hash"
:
"Qmb1US8uyZeEpMyc56wVZy2cDFdQjNFojAUYVCoo9ieTqp"
,
"name"
:
"go-stream-muxer"
,
...
...
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