Unverified Commit 3f52705c authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #111 from ywh254/feat/add-datastore-close

feat(datastore): expose datastore Close()
parents 3a9490ad 1b6dd8f2
...@@ -112,3 +112,7 @@ func (d *Datastore) Query(q dsq.Query) (dsq.Results, error) { ...@@ -112,3 +112,7 @@ func (d *Datastore) Query(q dsq.Query) (dsq.Results, error) {
func (d *Datastore) DiskUsage() (uint64, error) { func (d *Datastore) DiskUsage() (uint64, error) {
return ds.DiskUsage(d.child) return ds.DiskUsage(d.child)
} }
func (d *Datastore) Close() error {
return d.child.Close()
}
...@@ -2,6 +2,7 @@ package datastore ...@@ -2,6 +2,7 @@ package datastore
import ( import (
"errors" "errors"
"io"
"time" "time"
query "github.com/ipfs/go-datastore/query" query "github.com/ipfs/go-datastore/query"
...@@ -33,6 +34,7 @@ should be checked by callers. ...@@ -33,6 +34,7 @@ should be checked by callers.
type Datastore interface { type Datastore interface {
Read Read
Write Write
io.Closer
} }
// Write is the write-side of the Datastore interface. // Write is the write-side of the Datastore interface.
......
...@@ -94,6 +94,11 @@ func (d *Failstore) DiskUsage() (uint64, error) { ...@@ -94,6 +94,11 @@ func (d *Failstore) DiskUsage() (uint64, error) {
return ds.DiskUsage(d.child) return ds.DiskUsage(d.child)
} }
// Close implements the Datastore interface
func (d *Failstore) Close() error {
return d.child.Close()
}
// FailBatch implements batching operations on the Failstore. // FailBatch implements batching operations on the Failstore.
type FailBatch struct { type FailBatch struct {
cb ds.Batch cb ds.Batch
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment