Documentation ¶
Index ¶
- func GetValue(db *badger.DB, key string) (error, []byte)
- func List(db *badger.DB, prefix string) error
- func OpenBadgerDB(dir string, logLevel int) (*badger.DB, error)
- func Set(db *badger.DB, key string, value string) (err error)
- func UpdateBadgerDB(db *badger.DB, updates map[string]string) (err error)
- type BadgerDB
- func (bdb *BadgerDB) Close() error
- func (bdb *BadgerDB) Delete(namespace, key []byte) error
- func (bdb *BadgerDB) Get(namespace, key []byte) (value []byte, err error)
- func (bdb *BadgerDB) Has(namespace, key []byte) (ok bool, err error)
- func (bdb *BadgerDB) List(namespace, prefix []byte) error
- func (bdb *BadgerDB) Set(namespace, key, value []byte) error
- func (bdb *BadgerDB) SetWithMeta(namespace, key, value []byte, meta byte) error
- func (bdb *BadgerDB) SetWithTTL(namespace, key, value []byte, ttl time.Duration) error
- type DB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenBadgerDB ¶
func UpdateBadgerDB ¶
Types ¶
type BadgerDB ¶
type BadgerDB struct {
// contains filtered or unexported fields
}
BadgerDB is a wrapper around a BadgerDB backend database that implements the DB interface.
func NewBadgerDB ¶
func (*BadgerDB) Close ¶
Close implements the DB interface. It closes the connection to the underlying BadgerDB database as well as invoking the context's cancel function.
func (*BadgerDB) SetWithMeta ¶
type DB ¶
type DB interface { Get(namespace, key []byte) (value []byte, err error) Set(namespace, key, value []byte) error SetWithTTL(namespace, key, value []byte, ttl time.Duration) error SetWithMeta(namespace, key, value []byte, meta byte) error Delete(namespace, key []byte) error Has(namespace, key []byte) (bool, error) List(namespace, prefix []byte) error Close() error }
DB defines an embedded key/value store database interface.
Click to show internal directories.
Click to hide internal directories.