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
8704c1c1
Commit
8704c1c1
authored
Sep 05, 2018
by
Kevin Atkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gx update and fix code to use new Cid type
parent
e29dbe2f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
offline.go
offline.go
+3
-3
offline_test.go
offline_test.go
+2
-2
package.json
package.json
+10
-10
No files found.
offline.go
View file @
8704c1c1
...
...
@@ -24,7 +24,7 @@ type offlineExchange struct {
// GetBlock 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
(
e
*
offlineExchange
)
GetBlock
(
_
context
.
Context
,
k
*
cid
.
Cid
)
(
blocks
.
Block
,
error
)
{
func
(
e
*
offlineExchange
)
GetBlock
(
_
context
.
Context
,
k
cid
.
Cid
)
(
blocks
.
Block
,
error
)
{
return
e
.
bs
.
Get
(
k
)
}
...
...
@@ -40,11 +40,11 @@ func (_ *offlineExchange) Close() error {
return
nil
}
func
(
e
*
offlineExchange
)
GetBlocks
(
ctx
context
.
Context
,
ks
[]
*
cid
.
Cid
)
(
<-
chan
blocks
.
Block
,
error
)
{
func
(
e
*
offlineExchange
)
GetBlocks
(
ctx
context
.
Context
,
ks
[]
cid
.
Cid
)
(
<-
chan
blocks
.
Block
,
error
)
{
out
:=
make
(
chan
blocks
.
Block
)
go
func
()
{
defer
close
(
out
)
var
misses
[]
*
cid
.
Cid
var
misses
[]
cid
.
Cid
for
_
,
k
:=
range
ks
{
hit
,
err
:=
e
.
bs
.
Get
(
k
)
if
err
!=
nil
{
...
...
offline_test.go
View file @
8704c1c1
...
...
@@ -51,8 +51,8 @@ func TestGetBlocks(t *testing.T) {
}
}
request
:=
func
()
[]
*
cid
.
Cid
{
var
ks
[]
*
cid
.
Cid
request
:=
func
()
[]
cid
.
Cid
{
var
ks
[]
cid
.
Cid
for
_
,
b
:=
range
expected
{
ks
=
append
(
ks
,
b
.
Cid
())
...
...
package.json
View file @
8704c1c1
...
...
@@ -9,33 +9,33 @@
"gxDependencies"
:
[
{
"author"
:
"hsanjuan"
,
"hash"
:
"Qme
g56ecxRnVv7VWViMrDeEMoBHaNFMs4vQnyQrJ79Zz7i
"
,
"hash"
:
"Qme
MussyD8s3fQ3pM19ZsfbxvomEqPV9FvczLMWyBDYSnS
"
,
"name"
:
"go-ipfs-blockstore"
,
"version"
:
"0.
0.2
0"
"version"
:
"0.
1.
0"
},
{
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
ZFbDTY9jfSBms2MchvYM9oYRbAF19K7Pby47yDBfpPrb
"
,
"hash"
:
"Qm
PSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7
"
,
"name"
:
"go-cid"
,
"version"
:
"0.
8
.0"
"version"
:
"0.
9
.0"
},
{
"author"
:
"hsanjuan"
,
"hash"
:
"Qm
Ww71Mz9PXKgYG8ZfTYN7Ax2Zm48Eurbne3wC2y7CKmLz
"
,
"hash"
:
"Qm
R1nncPsZR14A4hWr39mq8Lm7BGgS68bHVT9nop8NpWEM
"
,
"name"
:
"go-ipfs-exchange-interface"
,
"version"
:
"0.
0.6
"
"version"
:
"0.
1.0
"
},
{
"author"
:
"stebalien"
,
"hash"
:
"Qm
WAzSEoqZ6xU6pu8yL8e5WaMb7wtbfbhhN4p1DknUPtr3
"
,
"hash"
:
"Qm
RcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM
"
,
"name"
:
"go-block-format"
,
"version"
:
"0.
1.11
"
"version"
:
"0.
2.0
"
},
{
"author"
:
"hsanjuan"
,
"hash"
:
"Qm
c3bqcjeTjbvgbMW5MvW8SBXnEmTquEx9CXSjT2myoFmi
"
,
"hash"
:
"Qm
Uf9xAmbHndjh31YNRugNeyNX6mDTUDuWN1bVTmUriwdZ
"
,
"name"
:
"go-ipfs-blocksutil"
,
"version"
:
"0.
0.6
"
"version"
:
"0.
1.0
"
}
],
"gxVersion"
:
"0.12.1"
,
...
...
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