Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-swarm
Commits
464328f9
Commit
464328f9
authored
Nov 18, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate to gx namespace
parent
1142e3ca
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
45 additions
and
45 deletions
+45
-45
addr/addr.go
addr/addr.go
+4
-4
addr/addr_test.go
addr/addr_test.go
+2
-2
dial_test.go
dial_test.go
+3
-3
peers_test.go
peers_test.go
+2
-2
simul_test.go
simul_test.go
+2
-2
swarm.go
swarm.go
+10
-10
swarm_addr.go
swarm_addr.go
+1
-1
swarm_addr_test.go
swarm_addr_test.go
+2
-2
swarm_conn.go
swarm_conn.go
+3
-3
swarm_dial.go
swarm_dial.go
+4
-4
swarm_listen.go
swarm_listen.go
+3
-3
swarm_net.go
swarm_net.go
+3
-3
swarm_net_test.go
swarm_net_test.go
+1
-1
swarm_notif_test.go
swarm_notif_test.go
+2
-2
swarm_stream.go
swarm_stream.go
+1
-1
swarm_test.go
swarm_test.go
+2
-2
No files found.
addr/addr.go
View file @
464328f9
...
...
@@ -3,11 +3,11 @@ package addrutil
import
(
"fmt"
logging
"
QmWRypnfEwrgH4k93KEHN5hng7VjKYkWmzDYRuTZeh2Mgh
/go-log"
logging
"
gx/QmfZZB1aVXWA4kaR5R4e9NifERT366TTCSagkfhmAbYLsu
/go-log"
manet
"
QmRCPT5WRph8aWXmaT2Rfn6ac98YRUUJnNURpD3hNAWp4f
/go-multiaddr-net"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
manet
"
gx/QmNT7d1e4Xcp3KcsvxyzUHVtqrR43uypoxLLzdKj6YZga2
/go-multiaddr-net"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
)
var
log
=
logging
.
Logger
(
"github.com/ipfs/go-libp2p/p2p/net/swarm/addr"
)
...
...
addr/addr_test.go
View file @
464328f9
...
...
@@ -3,8 +3,8 @@ package addrutil
import
(
"testing"
manet
"
QmRCPT5WRph8aWXmaT2Rfn6ac98YRUUJnNURpD3hNAWp4f
/go-multiaddr-net"
ma
"
QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83
/go-multiaddr"
manet
"
gx/QmNT7d1e4Xcp3KcsvxyzUHVtqrR43uypoxLLzdKj6YZga2
/go-multiaddr-net"
ma
"
gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj
/go-multiaddr"
)
func
newMultiaddr
(
t
*
testing
.
T
,
s
string
)
ma
.
Multiaddr
{
...
...
dial_test.go
View file @
464328f9
...
...
@@ -13,9 +13,9 @@ import (
testutil
"github.com/ipfs/go-libp2p/testutil"
ci
"github.com/ipfs/go-libp2p/testutil/ci"
manet
"
QmRCPT5WRph8aWXmaT2Rfn6ac98YRUUJnNURpD3hNAWp4f
/go-multiaddr-net"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
manet
"
gx/QmNT7d1e4Xcp3KcsvxyzUHVtqrR43uypoxLLzdKj6YZga2
/go-multiaddr-net"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
)
func
acceptAndHang
(
l
net
.
Listener
)
{
...
...
peers_test.go
View file @
464328f9
...
...
@@ -5,8 +5,8 @@ import (
peer
"github.com/ipfs/go-libp2p/p2p/peer"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
)
func
TestPeers
(
t
*
testing
.
T
)
{
...
...
simul_test.go
View file @
464328f9
...
...
@@ -9,8 +9,8 @@ import (
peer
"github.com/ipfs/go-libp2p/p2p/peer"
ci
"github.com/ipfs/go-libp2p/testutil/ci"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
)
func
TestSimultOpen
(
t
*
testing
.
T
)
{
...
...
swarm.go
View file @
464328f9
...
...
@@ -16,16 +16,16 @@ import (
transport
"github.com/ipfs/go-libp2p/p2p/net/transport"
peer
"github.com/ipfs/go-libp2p/p2p/peer"
ps
t
"
QmPxuHs2NQjz16gnvndgkzHkm5PjtqbB5rwoSpLusBkQ7Q/go-stream-muxer
"
ps
mss
"QmPxuHs2NQjz16gnvndgkzHkm5PjtqbB5rwoSpLusBkQ7Q
/go-stream-muxer
/multistream
"
"QmSir6qPL1tjuxd8LkR8VZq6v625ExAUVs2eCLeqQuaPGU/goprocess
"
goprocessctx
"QmSir6qPL1tjuxd8LkR8VZq6v625ExAUVs2eCLeqQuaPGU/goprocess/context
"
ps
"QmTgxFwS1nDK126fH5XPnLFcxcDFsxKbPPnCBwyRWNAjDX/go-peerstream
"
mafilter
"QmYhewVqJhkgEsm3AYVUbpT14q2P9V4Xb7np9JXKua6y7A/multiaddr-filter
"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
logging
"
QmWRypnfEwrgH4k93KEHN5hng7VjKYkWmzDYRuTZeh2Mgh
/go-log"
ps
"
gx/QmQMkNFMuh1UJbdaggASZpLtCroTnAYcWNenYL5hrzLJrT/go-peerstream
"
ps
t
"gx/QmRmT6MSnfhRDW1PTUGSd3z4fqXK48GUequQAZzeT4c5iC
/go-stream-muxer"
psmss
"gx/QmRmT6MSnfhRDW1PTUGSd3z4fqXK48GUequQAZzeT4c5iC/go-stream-muxer/multistream
"
mafilter
"gx/QmVCmuhgDFer5MW5737Z8GtBEGpUyEkFnLUv4ASDWnLZdC/multiaddr-filter
"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
"gx/QmfDXyLfKNfja2XebomRZjZ2UZCa4BDyFoCymKtzNRVQ5b/goprocess
"
goprocessctx
"gx/QmfDXyLfKNfja2XebomRZjZ2UZCa4BDyFoCymKtzNRVQ5b/goprocess/context
"
logging
"
gx/QmfZZB1aVXWA4kaR5R4e9NifERT366TTCSagkfhmAbYLsu
/go-log"
)
var
log
=
logging
.
Logger
(
"swarm2"
)
...
...
swarm_addr.go
View file @
464328f9
...
...
@@ -4,7 +4,7 @@ import (
conn
"github.com/ipfs/go-libp2p/p2p/net/conn"
addrutil
"github.com/ipfs/go-libp2p/p2p/net/swarm/addr"
ma
"
QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83
/go-multiaddr"
ma
"
gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj
/go-multiaddr"
)
// ListenAddresses returns a list of addresses at which this swarm listens.
...
...
swarm_addr_test.go
View file @
464328f9
...
...
@@ -8,8 +8,8 @@ import (
peer
"github.com/ipfs/go-libp2p/p2p/peer"
testutil
"github.com/ipfs/go-libp2p/testutil"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
)
func
TestFilterAddrs
(
t
*
testing
.
T
)
{
...
...
swarm_conn.go
View file @
464328f9
...
...
@@ -8,9 +8,9 @@ import (
conn
"github.com/ipfs/go-libp2p/p2p/net/conn"
peer
"github.com/ipfs/go-libp2p/p2p/peer"
ps
"
QmTgxFwS1nDK126fH5XPnLFcxcDFsxKbPPnCBwyRWNAjDX
/go-peerstream"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
ps
"
gx/QmQMkNFMuh1UJbdaggASZpLtCroTnAYcWNenYL5hrzLJrT
/go-peerstream"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
)
// a Conn is a simple wrapper around a ps.Conn that also exposes
...
...
swarm_dial.go
View file @
464328f9
...
...
@@ -8,14 +8,14 @@ import (
"sync"
"time"
"QmRCPT5WRph8aWXmaT2Rfn6ac98YRUUJnNURpD3hNAWp4f/go-multiaddr-net
"
lgbl
"github.com/ipfs/go-libp2p/loggables
"
conn
"github.com/ipfs/go-libp2p/p2p/net/conn"
addrutil
"github.com/ipfs/go-libp2p/p2p/net/swarm/addr"
peer
"github.com/ipfs/go-libp2p/p2p/peer"
lgbl
"github.com/ipfs/go-libp2p/loggables
"
"gx/QmNT7d1e4Xcp3KcsvxyzUHVtqrR43uypoxLLzdKj6YZga2/go-multiaddr-net
"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
)
// Diagram of dial sync:
...
...
swarm_listen.go
View file @
464328f9
...
...
@@ -9,9 +9,9 @@ import (
conn
"github.com/ipfs/go-libp2p/p2p/net/conn"
transport
"github.com/ipfs/go-libp2p/p2p/net/transport"
ps
"
QmTgxFwS1nDK126fH5XPnLFcxcDFsxKbPPnCBwyRWNAjDX
/go-peerstream"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
ps
"
gx/QmQMkNFMuh1UJbdaggASZpLtCroTnAYcWNenYL5hrzLJrT
/go-peerstream"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
)
// Open listeners and reuse-dialers for the given addresses
...
...
swarm_net.go
View file @
464328f9
...
...
@@ -8,9 +8,9 @@ import (
metrics
"github.com/ipfs/go-libp2p/p2p/metrics"
inet
"github.com/ipfs/go-libp2p/p2p/net"
"QmSir6qPL1tjuxd8LkR8VZq6v625ExAUVs2eCLeqQuaPGU/goprocess
"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"
gx/
QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context"
"gx/QmfDXyLfKNfja2XebomRZjZ2UZCa4BDyFoCymKtzNRVQ5b/goprocess
"
)
// Network implements the inet.Network interface.
...
...
swarm_net_test.go
View file @
464328f9
...
...
@@ -5,7 +5,7 @@ import (
"testing"
"time"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context"
context
"
gx/
QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context"
inet
"github.com/ipfs/go-libp2p/p2p/net"
testutil
"github.com/ipfs/go-libp2p/p2p/test/util"
)
...
...
swarm_notif_test.go
View file @
464328f9
...
...
@@ -4,8 +4,8 @@ import (
"testing"
"time"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
inet
"github.com/ipfs/go-libp2p/p2p/net"
peer
"github.com/ipfs/go-libp2p/p2p/peer"
...
...
swarm_stream.go
View file @
464328f9
...
...
@@ -3,7 +3,7 @@ package swarm
import
(
inet
"github.com/ipfs/go-libp2p/p2p/net"
ps
"
QmTgxFwS1nDK126fH5XPnLFcxcDFsxKbPPnCBwyRWNAjDX
/go-peerstream"
ps
"
gx/QmQMkNFMuh1UJbdaggASZpLtCroTnAYcWNenYL5hrzLJrT
/go-peerstream"
)
// a Stream is a wrapper around a ps.Stream that exposes a way to get
...
...
swarm_test.go
View file @
464328f9
...
...
@@ -14,8 +14,8 @@ import (
peer
"github.com/ipfs/go-libp2p/p2p/peer"
testutil
"github.com/ipfs/go-libp2p/testutil"
context
"QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
ma
"QmbWxL1aXQhBjc1XGjGF1f2KGBMCBYSuT2ThA8YXnXJK83/go-multiaddr
"
ma
"gx/QmVUi2ncqnU48zsPgR1rQosDGwY3SSZ1Ndp33j33YjXdsj/go-multiaddr
"
context
"gx/QmacZi9WygGK7Me8mH53pypyscHzU386aUZXpr28GZgUct/context
"
)
func
EchoStreamHandler
(
stream
inet
.
Stream
)
{
...
...
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