lotus/chain/store/splitstore/liveset.go

30 lines
495 B
Go
Raw Normal View History

2020-11-26 14:53:16 +00:00
package splitstore
import (
"fmt"
"path/filepath"
2020-11-26 14:53:16 +00:00
cid "github.com/ipfs/go-cid"
)
type LiveSet interface {
Mark(cid.Cid) error
Has(cid.Cid) (bool, error)
Close() error
}
2020-11-26 15:49:47 +00:00
2020-11-26 16:58:03 +00:00
var markBytes = []byte{}
type LiveSetEnv interface {
NewLiveSet(name string) (LiveSet, error)
Close() error
}
func NewLiveSetEnv(path string, useLMDB bool) (LiveSetEnv, error) {
if useLMDB {
return NewLMDBLiveSetEnv(filepath.Join(path, "sweep.lmdb"))
}
return nil, fmt.Errorf("FIXME: non-lmdb livesets")
}