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
dms3
go-dms3
Commits
3f97e7e3
Commit
3f97e7e3
authored
10 years ago
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goling: PeerId -> ID
parent
f718bd6a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
18 deletions
+17
-18
bitswap/bitswap.go
bitswap/bitswap.go
+2
-2
config/config.go
config/config.go
+1
-1
core/core.go
core/core.go
+3
-3
peer/peer.go
peer/peer.go
+8
-8
peer/peer_test.go
peer/peer_test.go
+1
-1
swarm/conn.go
swarm/conn.go
+1
-1
swarm/conn_test.go
swarm/conn_test.go
+1
-1
util/util_test.go
util/util_test.go
+0
-1
No files found.
bitswap/bitswap.go
View file @
3f97e7e3
package
bitswap
import
(
"github.com/jbenet/go-ipfs/peer"
peer
"github.com/jbenet/go-ipfs/peer"
)
// aliases
...
...
@@ -11,7 +11,7 @@ type Ledger struct {
}
type
BitSwap
struct
{
Ledgers
map
[
peer
.
PeerId
]
*
Ledger
Ledgers
map
[
peer
.
ID
]
*
Ledger
HaveList
map
[
multihash
.
Multihash
]
*
block
.
Block
WantList
[]
*
multihash
.
Multihash
}
This diff is collapsed.
Click to expand it.
config/config.go
View file @
3f97e7e3
...
...
@@ -7,7 +7,7 @@ import (
// Identity tracks the configuration of the local node's identity.
type
Identity
struct
{
PeerI
d
string
PeerI
D
string
}
// Datastore tracks the configuration of the datastore.
...
...
This diff is collapsed.
Click to expand it.
core/core.go
View file @
3f97e7e3
...
...
@@ -19,8 +19,8 @@ type IpfsNode struct {
// the local node's identity
Identity
*
peer
.
Peer
// the
book
of other nodes (
a map of
Peer instances)
Peer
Book
*
peer
.
PeerBook
// the
map
of other nodes (Peer instances)
Peer
Map
*
peer
.
Map
// the local datastore
Datastore
ds
.
Datastore
...
...
@@ -67,7 +67,7 @@ func NewIpfsNode(cfg *config.Config) (*IpfsNode, error) {
n
:=
&
IpfsNode
{
Config
:
cfg
,
Peer
Book
:
&
peer
.
PeerBook
{},
Peer
Map
:
&
peer
.
Map
{},
Datastore
:
d
,
Blocks
:
bs
,
DAG
:
dag
,
...
...
This diff is collapsed.
Click to expand it.
peer/peer.go
View file @
3f97e7e3
...
...
@@ -6,22 +6,22 @@ import (
mh
"github.com/jbenet/go-multihash"
)
//
PeerId
is a byte slice representing the identity of a peer.
type
PeerId
mh
.
Multihash
//
ID
is a byte slice representing the identity of a peer.
type
ID
mh
.
Multihash
//
PeerBook
maps Key (string) : *Peer (slices are not comparable).
type
PeerBook
map
[
u
.
Key
]
*
Peer
//
Map
maps Key (string) : *Peer (slices are not comparable).
type
Map
map
[
u
.
Key
]
*
Peer
// Peer represents the identity information of an IPFS Node, including
//
a PeerId
, and relevant Addresses.
//
ID
, and relevant Addresses.
type
Peer
struct
{
I
d
PeerId
I
D
ID
Addresses
[]
*
ma
.
Multiaddr
}
// Key returns the
PeerId
as a Key (string) for maps.
// Key returns the
ID
as a Key (string) for maps.
func
(
p
*
Peer
)
Key
()
u
.
Key
{
return
u
.
Key
(
p
.
I
d
)
return
u
.
Key
(
p
.
I
D
)
}
// AddAddress adds the given Multiaddr address to Peer's addresses.
...
...
This diff is collapsed.
Click to expand it.
peer/peer_test.go
View file @
3f97e7e3
...
...
@@ -26,7 +26,7 @@ func TestNetAddress(t *testing.T) {
return
}
p
:=
Peer
{
I
d
:
PeerId
(
mh
)}
p
:=
Peer
{
I
D
:
ID
(
mh
)}
p
.
AddAddress
(
tcp
)
p
.
AddAddress
(
udp
)
...
...
This diff is collapsed.
Click to expand it.
swarm/conn.go
View file @
3f97e7e3
...
...
@@ -23,7 +23,7 @@ type Conn struct {
Incoming
*
msgio
.
Chan
}
// ConnMap maps Keys (Peer
Id
s) to Connections.
// ConnMap maps Keys (Peer
.ID
s) to Connections.
type
ConnMap
map
[
u
.
Key
]
*
Conn
// Dial connects to a particular peer, over a given network
...
...
This diff is collapsed.
Click to expand it.
swarm/conn_test.go
View file @
3f97e7e3
...
...
@@ -20,7 +20,7 @@ func setupPeer(id string, addr string) (*peer.Peer, error) {
return
nil
,
err
}
p
:=
&
peer
.
Peer
{
I
d
:
peer
.
PeerId
(
mh
)}
p
:=
&
peer
.
Peer
{
I
D
:
peer
.
ID
(
mh
)}
p
.
AddAddress
(
tcp
)
return
p
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
util/util_test.go
View file @
3f97e7e3
...
...
@@ -2,7 +2,6 @@ package util
import
(
"bytes"
"fmt"
mh
"github.com/jbenet/go-multihash"
"testing"
)
...
...
This diff is collapsed.
Click to expand it.
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