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-exchange-offline
Commits
abc92d59
Commit
abc92d59
authored
Nov 18, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beginnings of a bitswap refactor
parent
7715d637
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
offline.go
offline.go
+2
-2
offline_test.go
offline_test.go
+1
-1
No files found.
offline.go
View file @
abc92d59
...
...
@@ -23,10 +23,10 @@ func NewOfflineExchange() exchange.Interface {
type
offlineExchange
struct
{
}
// Block returns nil to signal that a block could not be retrieved for the
//
Get
Block returns nil to signal that a block could not be retrieved for the
// given key.
// NB: This function may return before the timeout expires.
func
(
_
*
offlineExchange
)
Block
(
context
.
Context
,
u
.
Key
)
(
*
blocks
.
Block
,
error
)
{
func
(
_
*
offlineExchange
)
Get
Block
(
context
.
Context
,
u
.
Key
)
(
*
blocks
.
Block
,
error
)
{
return
nil
,
OfflineMode
}
...
...
offline_test.go
View file @
abc92d59
...
...
@@ -11,7 +11,7 @@ import (
func
TestBlockReturnsErr
(
t
*
testing
.
T
)
{
off
:=
NewOfflineExchange
()
_
,
err
:=
off
.
Block
(
context
.
Background
(),
u
.
Key
(
"foo"
))
_
,
err
:=
off
.
Get
Block
(
context
.
Background
(),
u
.
Key
(
"foo"
))
if
err
!=
nil
{
return
// as desired
}
...
...
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