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-unixfs
Commits
9b06ad53
Commit
9b06ad53
authored
10 years ago
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ledger file
parent
9c4e6703
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
25 deletions
+33
-25
bitswap/bitswap.go
bitswap/bitswap.go
+0
-25
bitswap/ledger.go
bitswap/ledger.go
+33
-0
No files found.
bitswap/bitswap.go
View file @
9b06ad53
...
...
@@ -21,31 +21,6 @@ const PartnerWantListMax = 10
// access/lookups.
type
KeySet
map
[
u
.
Key
]
struct
{}
// Ledger stores the data exchange relationship between two peers.
type
Ledger
struct
{
// Partner is the ID of the remote Peer.
Partner
peer
.
ID
// BytesSent counts the number of bytes the local peer sent to Partner
BytesSent
uint64
// BytesReceived counts the number of bytes local peer received from Partner
BytesReceived
uint64
// FirstExchnage is the time of the first data exchange.
FirstExchange
*
time
.
Time
// LastExchange is the time of the last data exchange.
LastExchange
*
time
.
Time
// WantList is a (bounded, small) set of keys that Partner desires.
WantList
KeySet
}
// LedgerMap lists Ledgers by their Partner key.
type
LedgerMap
map
[
u
.
Key
]
*
Ledger
// BitSwap instances implement the bitswap protocol.
type
BitSwap
struct
{
// peer is the identity of this (local) node.
...
...
This diff is collapsed.
Click to expand it.
bitswap/ledger.go
0 → 100644
View file @
9b06ad53
package
bitswap
import
(
peer
"github.com/jbenet/go-ipfs/peer"
u
"github.com/jbenet/go-ipfs/util"
"time"
)
// Ledger stores the data exchange relationship between two peers.
type
Ledger
struct
{
// Partner is the ID of the remote Peer.
Partner
peer
.
ID
// BytesSent counts the number of bytes the local peer sent to Partner
BytesSent
uint64
// BytesReceived counts the number of bytes local peer received from Partner
BytesReceived
uint64
// FirstExchnage is the time of the first data exchange.
FirstExchange
*
time
.
Time
// LastExchange is the time of the last data exchange.
LastExchange
*
time
.
Time
// WantList is a (bounded, small) set of keys that Partner desires.
WantList
KeySet
}
// LedgerMap lists Ledgers by their Partner key.
type
LedgerMap
map
[
u
.
Key
]
*
Ledger
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