Documentation
¶
Index ¶
- Constants
- type Config
- type Database
- func (d *Database) Close() error
- func (d *Database) Compact(start []byte, limit []byte) error
- func (d *Database) Delete(key []byte) error
- func (d *Database) Empty() (bool, error)
- func (d *Database) Get(key []byte) ([]byte, error)
- func (d *Database) GetSnapshot() (database.Database, error)
- func (d *Database) Has(key []byte) (bool, error)
- func (d *Database) HealthCheck(ctx context.Context) (interface{}, error)
- func (d *Database) Len() (int, error)
- func (d *Database) NewBatch() database.Batch
- func (d *Database) NewIterator() database.Iterator
- func (d *Database) NewIteratorWithPrefix(prefix []byte) database.Iterator
- func (d *Database) NewIteratorWithStart(start []byte) database.Iterator
- func (d *Database) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iterator
- func (d *Database) Put(key []byte, value []byte) error
Constants ¶
View Source
const Name = "badgerdb"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.2.2
type Config struct {
SyncWrites bool `json:"syncWrites"`
NumCompactors int `json:"numCompactors"`
NumMemtables int `json:"numMemtables"`
MemTableSize int64 `json:"memTableSize"`
ValueLogFileSize int64 `json:"valueLogFileSize"`
ValueLogMaxEntries uint32 `json:"valueLogMaxEntries"`
BlockCacheSize int64 `json:"blockCacheSize"`
IndexCacheSize int64 `json:"indexCacheSize"`
BloomFalsePositive float64 `json:"bloomFalsePositive"`
ValueThreshold int `json:"valueThreshold"`
Compression string `json:"compression"`
ZSTDCompressionLevel int `json:"zstdCompressionLevel"`
}
Config represents BadgerDB configuration
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is a badgerdb backed database
func New ¶
func New(file string, configBytes []byte, namespace string, metrics prometheus.Registerer) (*Database, error)
New returns a new badgerdb-backed database
func (*Database) Empty ¶
Empty returns true if the database doesn't contain any keys (but not deleted keys)
func (*Database) GetSnapshot ¶
GetSnapshot implements the database.Database interface
func (*Database) HealthCheck ¶
HealthCheck returns nil if the database is healthy, non-nil otherwise.
func (*Database) NewIterator ¶
NewIterator implements the Database interface
func (*Database) NewIteratorWithPrefix ¶
NewIteratorWithPrefix implements the Database interface
func (*Database) NewIteratorWithStart ¶
NewIteratorWithStart implements the Database interface
func (*Database) NewIteratorWithStartAndPrefix ¶
NewIteratorWithStartAndPrefix implements the Database interface
Click to show internal directories.
Click to hide internal directories.