Documentation ¶
Index ¶
- type BadgerDBHandle
- func (h *BadgerDBHandle) Close() error
- func (h *BadgerDBHandle) CompactRange(start, limit []byte) error
- func (h *BadgerDBHandle) Delete(key []byte) error
- func (h *BadgerDBHandle) Get(key []byte) ([]byte, error)
- func (h *BadgerDBHandle) GetDbType() string
- func (h *BadgerDBHandle) GetWriteBatchSize() uint64
- func (h *BadgerDBHandle) Has(key []byte) (bool, error)
- func (h *BadgerDBHandle) NewIteratorWithPrefix(prefix []byte) (protocol.Iterator, error)
- func (h *BadgerDBHandle) NewIteratorWithRange(startKey []byte, limitKey []byte) (protocol.Iterator, error)
- func (h *BadgerDBHandle) Put(key []byte, value []byte) error
- func (h *BadgerDBHandle) WriteBatch(batch protocol.StoreBatcher, sync bool) error
- type BadgerDbConfig
- type Iterator
- type NewBadgerDBOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgerDBHandle ¶
type BadgerDBHandle struct {
// contains filtered or unexported fields
}
BadgerDBHandle encapsulated handle to badgerDB
func NewBadgerDBHandle ¶
func NewBadgerDBHandle(input *NewBadgerDBOptions) *BadgerDBHandle
func (*BadgerDBHandle) CompactRange ¶
func (h *BadgerDBHandle) CompactRange(start, limit []byte) error
CompactRange compacts the underlying DB for the given key range.
func (*BadgerDBHandle) Delete ¶
func (h *BadgerDBHandle) Delete(key []byte) error
Delete deletes the given key
func (*BadgerDBHandle) Get ¶
func (h *BadgerDBHandle) Get(key []byte) ([]byte, error)
Get returns the value for the given key, or returns nil if none exists
func (*BadgerDBHandle) GetDbType ¶
func (h *BadgerDBHandle) GetDbType() string
GetDbType returns db type
func (*BadgerDBHandle) GetWriteBatchSize ¶
func (h *BadgerDBHandle) GetWriteBatchSize() uint64
GetWriteBatchSize returns write batch size
func (*BadgerDBHandle) Has ¶
func (h *BadgerDBHandle) Has(key []byte) (bool, error)
Has return true if the given key exist, or return false if none exists
func (*BadgerDBHandle) NewIteratorWithPrefix ¶
func (h *BadgerDBHandle) NewIteratorWithPrefix(prefix []byte) (protocol.Iterator, error)
NewIteratorWithPrefix returns an iterator that contains all the key-values with given prefix
func (*BadgerDBHandle) NewIteratorWithRange ¶
func (h *BadgerDBHandle) NewIteratorWithRange(startKey []byte, limitKey []byte) (protocol.Iterator, error)
NewIteratorWithRange returns an iterator that contains all the key-values between given key ranges start is included in the results and limit is excluded.
func (*BadgerDBHandle) Put ¶
func (h *BadgerDBHandle) Put(key []byte, value []byte) error
Put saves the key-values
func (*BadgerDBHandle) WriteBatch ¶
func (h *BadgerDBHandle) WriteBatch(batch protocol.StoreBatcher, sync bool) error
WriteBatch writes a batch in an atomic operation
type BadgerDbConfig ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func NewIterator ¶
type NewBadgerDBOptions ¶
type NewBadgerDBOptions struct { Config *BadgerDbConfig Logger protocol.Logger Encryptor crypto.SymmetricKey ChainId string DbFolder string }