import Viewable non-terminal blockstores.

This commit is contained in:
Raúl Kripalani
2020-11-10 13:16:24 +00:00
parent 54bf7c99d7
commit 577476b8fe
3 changed files with 6 additions and 8 deletions
+1 -7
View File
@@ -17,18 +17,11 @@ package blockstore
import (
"context"
"github.com/ipfs/go-cid"
ds "github.com/ipfs/go-datastore"
blockstore "github.com/ipfs/go-ipfs-blockstore"
)
// Viewer is a blockstore trait that can be implemented by blockstores
// that offer zero-copy access to blocks.
type Viewer interface {
View(cid cid.Cid, callback func([]byte) error) error
}
// NewTemporary returns a temporary blockstore.
func NewTemporary() MemStore {
return make(MemStore)
@@ -51,6 +44,7 @@ func NewBlockstore(dstore ds.Batching) blockstore.Blockstore {
// Alias so other packages don't have to import go-ipfs-blockstore
type Blockstore = blockstore.Blockstore
type Viewer = blockstore.Viewer
type GCBlockstore = blockstore.GCBlockstore
type CacheOpts = blockstore.CacheOpts
type GCLocker = blockstore.GCLocker