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
2738d720
Commit
2738d720
authored
Sep 15, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(bitswap) add interface
parent
dde6ad49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
bitswap/interface.go
bitswap/interface.go
+23
-0
No files found.
bitswap/interface.go
0 → 100644
View file @
2738d720
package
bitswap
import
(
"time"
blocks
"github.com/jbenet/go-ipfs/blocks"
u
"github.com/jbenet/go-ipfs/util"
)
type
Exchange
interface
{
// Block returns the block associated with a given key.
// TODO(brian): pass a context instead of a timeout
// TODO(brian): rename -> Block
GetBlock
(
k
u
.
Key
,
timeout
time
.
Duration
)
(
*
blocks
.
Block
,
error
)
// HasBlock asserts the existence of this block
// TODO(brian): rename -> HasBlock
// TODO(brian): accept a value, not a pointer
// TODO(brian): remove error return value. Should callers be concerned with
// whether the block was made available on the network?
HaveBlock
(
*
blocks
.
Block
)
error
}
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