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-blockstore
Commits
7adc396a
Unverified
Commit
7adc396a
authored
Nov 16, 2020
by
Raúl Kripalani
Committed by
GitHub
Nov 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make idstore implement io.Closer. (#60)
parent
3e8fd893
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
idstore.go
idstore.go
+9
-0
No files found.
idstore.go
View file @
7adc396a
...
...
@@ -2,6 +2,7 @@ package blockstore
import
(
"context"
"io"
blocks
"github.com/ipfs/go-block-format"
cid
"github.com/ipfs/go-cid"
...
...
@@ -16,6 +17,7 @@ type idstore struct {
var
_
Blockstore
=
(
*
idstore
)(
nil
)
var
_
Viewer
=
(
*
idstore
)(
nil
)
var
_
io
.
Closer
=
(
*
idstore
)(
nil
)
func
NewIdStore
(
bs
Blockstore
)
Blockstore
{
ids
:=
&
idstore
{
bs
:
bs
}
...
...
@@ -112,3 +114,10 @@ func (b *idstore) HashOnRead(enabled bool) {
func
(
b
*
idstore
)
AllKeysChan
(
ctx
context
.
Context
)
(
<-
chan
cid
.
Cid
,
error
)
{
return
b
.
bs
.
AllKeysChan
(
ctx
)
}
func
(
b
*
idstore
)
Close
()
error
{
if
c
,
ok
:=
b
.
bs
.
(
io
.
Closer
);
ok
{
return
c
.
Close
()
}
return
nil
}
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