Documentation ¶
Index ¶
- Constants
- func New(logger *zap.Logger, options basedb.Options) (basedb.IDb, error)
- type BadgerDb
- func (b *BadgerDb) Badger() *badger.DB
- func (b *BadgerDb) Close(logger *zap.Logger) error
- func (b *BadgerDb) CountByCollection(prefix []byte) (int64, error)
- func (b *BadgerDb) Delete(prefix []byte, key []byte) error
- func (b *BadgerDb) DeleteByPrefix(prefix []byte) (int, error)
- func (b *BadgerDb) FullGC(ctx context.Context) error
- func (b *BadgerDb) Get(prefix []byte, key []byte) (basedb.Obj, bool, error)
- func (b *BadgerDb) GetAll(logger *zap.Logger, prefix []byte, handler func(int, basedb.Obj) error) error
- func (b *BadgerDb) GetMany(logger *zap.Logger, prefix []byte, keys [][]byte, ...) error
- func (b *BadgerDb) QuickGC(ctx context.Context) error
- func (b *BadgerDb) RemoveAllByCollection(prefix []byte) error
- func (b *BadgerDb) Set(prefix []byte, key []byte, value []byte) error
- func (b *BadgerDb) SetMany(prefix []byte, n int, next func(int) (basedb.Obj, error)) error
- func (b *BadgerDb) Update(fn func(basedb.Txn) error) error
Constants ¶
View Source
const (
// EntryNotFoundError is an error for a storage entry not found
EntryNotFoundError = "EntryNotFoundError"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BadgerDb ¶
type BadgerDb struct {
// contains filtered or unexported fields
}
BadgerDb struct
func (*BadgerDb) Badger ¶ added in v0.4.7
func (b *BadgerDb) Badger() *badger.DB
Badger returns the underlying badger.DB
func (*BadgerDb) CountByCollection ¶ added in v0.0.4
CountByCollection return the object count for all keys under specified prefix(bucket)
func (*BadgerDb) DeleteByPrefix ¶ added in v0.3.2
DeleteByPrefix all items with this prefix
func (*BadgerDb) FullGC ¶ added in v0.4.7
FullGC runs a long garbage collection cycle to reclaim (ideally) all unused disk space. Designed to be called when the database is not being used.
func (*BadgerDb) GetAll ¶ added in v0.1.9
func (b *BadgerDb) GetAll(logger *zap.Logger, prefix []byte, handler func(int, basedb.Obj) error) error
GetAll returns all the items of a given collection
func (*BadgerDb) GetMany ¶ added in v0.1.8
func (b *BadgerDb) GetMany(logger *zap.Logger, prefix []byte, keys [][]byte, iterator func(basedb.Obj) error) error
GetMany return values for the given keys
func (*BadgerDb) QuickGC ¶ added in v0.4.7
QuickGC runs a short garbage collection cycle to reclaim some unused disk space. Designed to be called periodically while the database is being used.
func (*BadgerDb) RemoveAllByCollection ¶ added in v0.0.18
RemoveAllByCollection cleans all items in a collection
Click to show internal directories.
Click to hide internal directories.