mirror of
https://github.com/libp2p/go-libp2p-peerstore.git
synced 2025-03-31 14:00:06 +08:00
extract from 0.4.0
This commit is contained in:
parent
a754102d02
commit
5e7bc7b555
@ -2,7 +2,7 @@
|
|||||||
package addr
|
package addr
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
ma "github.com/jbenet/go-multiaddr"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddrSource is a source of addresses. It allows clients to retrieve
|
// AddrSource is a source of addresses. It allows clients to retrieve
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
ma "github.com/jbenet/go-multiaddr"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newAddrOrFatal(t *testing.T, s string) ma.Multiaddr {
|
func newAddrOrFatal(t *testing.T, s string) ma.Multiaddr {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
ma "github.com/jbenet/go-multiaddr"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
ma "github.com/jbenet/go-multiaddr"
|
||||||
)
|
)
|
||||||
|
|
||||||
func IDS(t *testing.T, ids string) ID {
|
func IDS(t *testing.T, ids string) ID {
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
testutil "github.com/ipfs/go-ipfs/util/testutil"
|
|
||||||
peer "github.com/ipfs/go-libp2p/p2p/peer"
|
peer "github.com/ipfs/go-libp2p/p2p/peer"
|
||||||
|
testutil "util/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLatencyEWMAFun(t *testing.T) {
|
func TestLatencyEWMAFun(t *testing.T) {
|
||||||
|
10
peer.go
10
peer.go
@ -7,13 +7,13 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
b58 "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58"
|
b58 "github.com/jbenet/go-base58"
|
||||||
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
ma "github.com/jbenet/go-multiaddr"
|
||||||
mh "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
|
mh "github.com/jbenet/go-multihash"
|
||||||
|
|
||||||
u "github.com/ipfs/go-ipfs/util"
|
logging "QmWRypnfEwrgH4k93KEHN5hng7VjKYkWmzDYRuTZeh2Mgh/go-log"
|
||||||
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
|
|
||||||
ic "github.com/ipfs/go-libp2p/p2p/crypto"
|
ic "github.com/ipfs/go-libp2p/p2p/crypto"
|
||||||
|
u "util"
|
||||||
)
|
)
|
||||||
|
|
||||||
var log = logging.Logger("peer")
|
var log = logging.Logger("peer")
|
||||||
|
@ -6,12 +6,12 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
u "github.com/ipfs/go-ipfs/util"
|
|
||||||
tu "github.com/ipfs/go-ipfs/util/testutil"
|
|
||||||
ic "github.com/ipfs/go-libp2p/p2p/crypto"
|
ic "github.com/ipfs/go-libp2p/p2p/crypto"
|
||||||
. "github.com/ipfs/go-libp2p/p2p/peer"
|
. "github.com/ipfs/go-libp2p/p2p/peer"
|
||||||
|
u "util"
|
||||||
|
tu "util/testutil"
|
||||||
|
|
||||||
b58 "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58"
|
b58 "github.com/jbenet/go-base58"
|
||||||
)
|
)
|
||||||
|
|
||||||
var gen1 keyset // generated
|
var gen1 keyset // generated
|
||||||
|
@ -7,9 +7,9 @@ import (
|
|||||||
|
|
||||||
ic "github.com/ipfs/go-libp2p/p2p/crypto"
|
ic "github.com/ipfs/go-libp2p/p2p/crypto"
|
||||||
|
|
||||||
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
|
ds "github.com/jbenet/go-datastore"
|
||||||
dssync "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync"
|
dssync "github.com/jbenet/go-datastore/sync"
|
||||||
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
ma "github.com/jbenet/go-multiaddr"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -5,9 +5,9 @@ import (
|
|||||||
"math/big"
|
"math/big"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
ks "Qma4vHVBYKDiKS5VpvtLNJHHDbL7S6VRsvxxmBnBFfKP3k/go-keyspace"
|
||||||
ks "github.com/ipfs/go-ipfs/routing/keyspace"
|
|
||||||
peer "github.com/ipfs/go-libp2p/p2p/peer"
|
peer "github.com/ipfs/go-libp2p/p2p/peer"
|
||||||
|
key "github.com/whyrusleeping/go-key"
|
||||||
)
|
)
|
||||||
|
|
||||||
// peerMetric tracks a peer and its distance to something else.
|
// peerMetric tracks a peer and its distance to something else.
|
||||||
|
@ -6,11 +6,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
|
||||||
u "github.com/ipfs/go-ipfs/util"
|
|
||||||
peer "github.com/ipfs/go-libp2p/p2p/peer"
|
peer "github.com/ipfs/go-libp2p/p2p/peer"
|
||||||
|
key "github.com/whyrusleeping/go-key"
|
||||||
|
u "util"
|
||||||
|
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestQueue(t *testing.T) {
|
func TestQueue(t *testing.T) {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package queue
|
package queue
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "golang.org/x/net/context"
|
||||||
logging "github.com/ipfs/go-ipfs/vendor/go-log-v1.0.0"
|
|
||||||
peer "github.com/ipfs/go-libp2p/p2p/peer"
|
peer "github.com/ipfs/go-libp2p/p2p/peer"
|
||||||
|
logging "QmWRypnfEwrgH4k93KEHN5hng7VjKYkWmzDYRuTZeh2Mgh/go-log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var log = logging.Logger("peerqueue")
|
var log = logging.Logger("peerqueue")
|
||||||
|
Loading…
Reference in New Issue
Block a user