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-bitswap
Commits
5597393d
Commit
5597393d
authored
Oct 27, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(bitswap/message) BitSwapMessage interface
parent
2c7761fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
message/message.go
message/message.go
+17
-2
No files found.
message/message.go
View file @
5597393d
...
@@ -14,10 +14,25 @@ import (
...
@@ -14,10 +14,25 @@ import (
// TODO move bs/msg/internal/pb to bs/internal/pb and rename pb package to bitswap_pb
// TODO move bs/msg/internal/pb to bs/internal/pb and rename pb package to bitswap_pb
type
BitSwapMessage
interface
{
type
BitSwapMessage
interface
{
// Wantlist returns a slice of unique keys that represent data wanted by
// the sender.
Wantlist
()
[]
u
.
Key
Wantlist
()
[]
u
.
Key
// Blocks returns a slice of unique blocks
Blocks
()
[]
blocks
.
Block
Blocks
()
[]
blocks
.
Block
AddWanted
(
k
u
.
Key
)
AddBlock
(
b
blocks
.
Block
)
// AddWanted adds the key to the Wantlist.
//
// Insertion order determines priority. That is, earlier insertions are
// deemed higher priority than keys inserted later.
//
// t = 0, msg.AddWanted(A)
// t = 1, msg.AddWanted(B)
//
// implies Priority(A) > Priority(B)
AddWanted
(
u
.
Key
)
AddBlock
(
blocks
.
Block
)
Exportable
Exportable
}
}
...
...
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