-
Notifications
You must be signed in to change notification settings - Fork 24
/
interface.go
27 lines (23 loc) · 1.04 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package dagstore
import (
"context"
carindex "github.com/ipld/go-car/v2/index"
mh "github.com/multiformats/go-multihash"
"github.com/filecoin-project/dagstore/mount"
"github.com/filecoin-project/dagstore/shard"
)
// Interface is the publicly exposed interface of the DAGStore. It exists
// for mocking or DI purposes.
type Interface interface {
Start(ctx context.Context) error
RegisterShard(ctx context.Context, key shard.Key, mnt mount.Mount, out chan ShardResult, opts RegisterOpts) error
DestroyShard(ctx context.Context, key shard.Key, out chan ShardResult, _ DestroyOpts) error
AcquireShard(ctx context.Context, key shard.Key, out chan ShardResult, _ AcquireOpts) error
RecoverShard(ctx context.Context, key shard.Key, out chan ShardResult, _ RecoverOpts) error
GetShardInfo(k shard.Key) (ShardInfo, error)
GetIterableIndex(key shard.Key) (carindex.IterableIndex, error)
AllShardsInfo() AllShardsInfo
ShardsContainingMultihash(ctx context.Context, h mh.Multihash) ([]shard.Key, error)
GC(ctx context.Context) (*GCResult, error)
Close() error
}