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
Hide whitespace changes
Inline
Side-by-side
examples/hosts/main.go
View file @
4dd30d82
package
main
import
(
"context"
"flag"
"fmt"
"io/ioutil"
...
...
@@ -17,7 +18,6 @@ import (
testutil
"github.com/libp2p/go-libp2p/testutil"
ma
"github.com/jbenet/go-multiaddr"
context
"golang.org/x/net/context"
)
// create a 'Host' with a random peer to listen on the given address
...
...
p2p/host/basic/basic_host.go
View file @
4dd30d82
package
basichost
import
(
"context"
"io"
"time"
...
...
@@ -15,7 +16,6 @@ import (
protocol
"github.com/libp2p/go-libp2p/p2p/protocol"
identify
"github.com/libp2p/go-libp2p/p2p/protocol/identify"
relay
"github.com/libp2p/go-libp2p/p2p/protocol/relay"
context
"golang.org/x/net/context"
msmux
"github.com/whyrusleeping/go-multistream"
)
...
...
p2p/host/basic/basic_host_test.go
View file @
4dd30d82
...
...
@@ -2,6 +2,7 @@ package basichost_test
import
(
"bytes"
"context"
"io"
"testing"
"time"
...
...
@@ -10,8 +11,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"
)
func
TestHostSimple
(
t
*
testing
.
T
)
{
...
...
p2p/host/basic/natmgr.go
View file @
4dd30d82
package
basichost
import
(
"context"
"sync"
lgbl
"github.com/ipfs/go-libp2p-loggables"
...
...
@@ -8,7 +9,6 @@ import (
goprocess
"github.com/jbenet/goprocess"
inat
"github.com/libp2p/go-libp2p/p2p/nat"
inet
"github.com/libp2p/go-libp2p/p2p/net"
context
"golang.org/x/net/context"
)
// natManager takes care of adding + removing port mappings to the nat.
...
...
p2p/host/host.go
View file @
4dd30d82
package
host
import
(
"context"
peer
"github.com/ipfs/go-libp2p-peer"
pstore
"github.com/ipfs/go-libp2p-peerstore"
logging
"github.com/ipfs/go-log"
...
...
@@ -9,7 +11,6 @@ import (
inet
"github.com/libp2p/go-libp2p/p2p/net"
protocol
"github.com/libp2p/go-libp2p/p2p/protocol"
msmux
"github.com/whyrusleeping/go-multistream"
context
"golang.org/x/net/context"
)
var
log
=
logging
.
Logger
(
"github.com/libp2p/go-libp2p/p2p/host"
)
...
...
p2p/host/routed/routed.go
View file @
4dd30d82
package
routedhost
import
(
"context"
"fmt"
"time"
...
...
@@ -13,7 +14,6 @@ import (
metrics
"github.com/libp2p/go-libp2p/p2p/metrics"
inet
"github.com/libp2p/go-libp2p/p2p/net"
protocol
"github.com/libp2p/go-libp2p/p2p/protocol"
context
"golang.org/x/net/context"
msmux
"github.com/whyrusleeping/go-multistream"
)
...
...
p2p/net/conn/conn.go
View file @
4dd30d82
package
conn
import
(
"context"
"fmt"
"io"
"net"
...
...
@@ -14,7 +15,6 @@ import (
mpool
"github.com/jbenet/go-msgio/mpool"
ma
"github.com/jbenet/go-multiaddr"
manet
"github.com/jbenet/go-multiaddr-net"
context
"golang.org/x/net/context"
)
var
log
=
logging
.
Logger
(
"conn"
)
...
...
p2p/net/conn/conn_test.go
View file @
4dd30d82
...
...
@@ -8,9 +8,9 @@ import (
"testing"
"time"
"context"
msgio
"github.com/jbenet/go-msgio"
travis
"github.com/libp2p/go-libp2p/testutil/ci/travis"
context
"golang.org/x/net/context"
)
func
msgioWrap
(
c
Conn
)
msgio
.
ReadWriter
{
...
...
p2p/net/conn/dial.go
View file @
4dd30d82
...
...
@@ -6,6 +6,7 @@ import (
"strings"
"time"
"context"
ci
"github.com/ipfs/go-libp2p-crypto"
lgbl
"github.com/ipfs/go-libp2p-loggables"
peer
"github.com/ipfs/go-libp2p-peer"
...
...
@@ -14,7 +15,6 @@ import (
transport
"github.com/libp2p/go-libp2p-transport"
addrutil
"github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
msmux
"github.com/whyrusleeping/go-multistream"
context
"golang.org/x/net/context"
)
type
WrapFunc
func
(
transport
.
Conn
)
transport
.
Conn
...
...
p2p/net/conn/dial_test.go
View file @
4dd30d82
...
...
@@ -17,10 +17,10 @@ import (
tu
"github.com/libp2p/go-libp2p/testutil"
tcpt
"github.com/libp2p/go-tcp-transport"
"context"
ma
"github.com/jbenet/go-multiaddr"
msmux
"github.com/whyrusleeping/go-multistream"
grc
"github.com/whyrusleeping/gorocheck"
context
"golang.org/x/net/context"
)
func
goroFilter
(
r
*
grc
.
Goroutine
)
bool
{
...
...
p2p/net/conn/listen.go
View file @
4dd30d82
package
conn
import
(
"context"
"fmt"
"io"
"net"
...
...
@@ -16,7 +17,6 @@ import (
transport
"github.com/libp2p/go-libp2p-transport"
filter
"github.com/libp2p/go-libp2p/p2p/net/filter"
msmux
"github.com/whyrusleeping/go-multistream"
context
"golang.org/x/net/context"
)
const
(
...
...
p2p/net/conn/secure_conn.go
View file @
4dd30d82
package
conn
import
(
"context"
"errors"
"net"
"time"
...
...
@@ -9,7 +10,6 @@ import (
peer
"github.com/ipfs/go-libp2p-peer"
secio
"github.com/ipfs/go-libp2p-secio"
ma
"github.com/jbenet/go-multiaddr"
context
"golang.org/x/net/context"
)
// secureConn wraps another Conn object with an encrypted channel.
...
...
p2p/net/conn/secure_conn_test.go
View file @
4dd30d82
...
...
@@ -2,6 +2,7 @@ package conn
import
(
"bytes"
"context"
"runtime"
"sync"
"testing"
...
...
@@ -9,8 +10,6 @@ import (
ic
"github.com/ipfs/go-libp2p-crypto"
travis
"github.com/libp2p/go-libp2p/testutil/ci/travis"
context
"golang.org/x/net/context"
)
func
upgradeToSecureConn
(
t
*
testing
.
T
,
ctx
context
.
Context
,
sk
ic
.
PrivKey
,
c
Conn
)
(
Conn
,
error
)
{
...
...
p2p/net/interface.go
View file @
4dd30d82
package
net
import
(
"context"
"io"
peer
"github.com/ipfs/go-libp2p-peer"
...
...
@@ -9,7 +10,6 @@ import (
"github.com/jbenet/goprocess"
conn
"github.com/libp2p/go-libp2p/p2p/net/conn"
protocol
"github.com/libp2p/go-libp2p/p2p/protocol"
context
"golang.org/x/net/context"
)
// MessageSizeMax is a soft (recommended) maximum for network messages.
...
...
p2p/net/mock/mock.go
View file @
4dd30d82
package
mocknet
import
(
"context"
logging
"github.com/ipfs/go-log"
context
"golang.org/x/net/context"
)
var
log
=
logging
.
Logger
(
"mocknet"
)
...
...
p2p/net/mock/mock_net.go
View file @
4dd30d82
...
...
@@ -11,13 +11,13 @@ import (
p2putil
"github.com/libp2p/go-libp2p/p2p/test/util"
testutil
"github.com/libp2p/go-libp2p/testutil"
"context"
ic
"github.com/ipfs/go-libp2p-crypto"
peer
"github.com/ipfs/go-libp2p-peer"
pstore
"github.com/ipfs/go-libp2p-peerstore"
ma
"github.com/jbenet/go-multiaddr"
"github.com/jbenet/goprocess"
goprocessctx
"github.com/jbenet/goprocess/context"
context
"golang.org/x/net/context"
)
// mocknet implements mocknet.Mocknet
...
...
p2p/net/mock/mock_notif_test.go
View file @
4dd30d82
package
mocknet
import
(
"context"
"testing"
"time"
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
TestNotifications
(
t
*
testing
.
T
)
{
...
...
p2p/net/mock/mock_peernet.go
View file @
4dd30d82
...
...
@@ -7,12 +7,12 @@ import (
inet
"github.com/libp2p/go-libp2p/p2p/net"
"context"
peer
"github.com/ipfs/go-libp2p-peer"
pstore
"github.com/ipfs/go-libp2p-peerstore"
ma
"github.com/jbenet/go-multiaddr"
"github.com/jbenet/goprocess"
goprocessctx
"github.com/jbenet/goprocess/context"
context
"golang.org/x/net/context"
)
// peernet implements inet.Network
...
...
p2p/net/mock/mock_test.go
View file @
4dd30d82
...
...
@@ -14,8 +14,8 @@ import (
protocol
"github.com/libp2p/go-libp2p/p2p/protocol"
testutil
"github.com/libp2p/go-libp2p/testutil"
"context"
detectrace
"github.com/jbenet/go-detect-race"
context
"golang.org/x/net/context"
)
func
randPeer
(
t
*
testing
.
T
)
peer
.
ID
{
...
...
p2p/net/swarm/addr/addr.go
View file @
4dd30d82
...
...
@@ -3,10 +3,10 @@ package addrutil
import
(
"fmt"
"context"
logging
"github.com/ipfs/go-log"
ma
"github.com/jbenet/go-multiaddr"
manet
"github.com/jbenet/go-multiaddr-net"
context
"golang.org/x/net/context"
_
"github.com/whyrusleeping/ws-transport"
)
...
...
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