Category is an enum type for representing the bookkeeping of different type
type Category int
const (
// PvtdataExpiry represents the bookkeeping related to expiry of pvtdata because of BTL policy
PvtdataExpiry Category = iota
// MetadataPresenceIndicator maintains the bookkeeping about whether metadata is ever set for a namespace
MetadataPresenceIndicator
)
Provider provides handle to different bookkeepers for the given ledger
type Provider interface {
// GetDBHandle returns a db handle that can be used for maintaining the bookkeeping of a given category
GetDBHandle(ledgerID string, cat Category) *leveldbhelper.DBHandle
// Close closes the BookkeeperProvider
Close()
}
func NewProvider() Provider
NewProvider instantiates a new provider
TestEnv provides the bookkeeper provider env for testing
type TestEnv struct {
TestProvider Provider
// contains filtered or unexported fields
}
func NewTestEnv(t testing.TB) *TestEnv
NewTestEnv construct a TestEnv for testing
func (env *TestEnv) Cleanup()
Cleanup cleansup the store env after testing