Documentation ¶
Overview ¶
Package layer wraps badger kv store for adding utilities.
Index ¶
- Variables
- type BeforeCommit
- type DB
- func (db *DB) Backup(w io.Writer, since uint64) (uint64, error)
- func (db *DB) Close() (err error)
- func (db *DB) GetMergeOperator(key []byte, f MergeFunc, dur time.Duration) *badger.MergeOperator
- func (db *DB) GetSequence(key []byte, bandwidth uint64) (*badger.Sequence, error)
- func (db *DB) Load(r io.Reader) error
- func (db *DB) NewTransaction(update bool) *Txn
- func (db *DB) RunValueLogGC(discardRatio float64) error
- func (db *DB) Size() (lsm int64, vlog int64)
- func (db *DB) Tables() []badger.TableInfo
- func (db *DB) Update(fn func(txn *Txn) error) error
- func (db *DB) UpdateWith(fn func(txn *Txn) error, beforeCommit BeforeCommit) error
- func (db *DB) View(fn func(txn *Txn) error) error
- type Entry
- type Item
- type IteratorOptions
- type ManagedDB
- type MergeFunc
- type Options
- type Txn
- func (txn *Txn) Commit(callback func(error)) error
- func (txn *Txn) CommitAt(commitTs uint64, callback func(error)) error
- func (txn *Txn) CommitAtWith(commitTs uint64, beforeCommit BeforeCommit, callback func(error)) error
- func (txn *Txn) CommitWith(beforeCommit BeforeCommit, callback func(error)) error
- func (txn *Txn) Delete(key []byte) error
- func (txn *Txn) Discard()
- func (txn *Txn) Get(key []byte) (item *badger.Item, rerr error)
- func (txn *Txn) NewIterator(opt IteratorOptions) *badger.Iterator
- func (txn *Txn) Set(key, val []byte) error
- func (txn *Txn) SetEntry(e *Entry) error
- func (txn *Txn) SetWithDiscard(key, val []byte, meta byte) error
- func (txn *Txn) SetWithMeta(key, val []byte, meta byte) error
- func (txn *Txn) SetWithTTL(key, val []byte, dur time.Duration) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrValueLogSize is returned when opt.ValueLogFileSize option is not within the valid // range. ErrValueLogSize = badger.ErrValueLogSize // ErrValueThreshold is returned when ValueThreshold is set to a value close to or greater than // uint16. ErrValueThreshold = badger.ErrValueThreshold // ErrKeyNotFound is returned when key isn't found on a txn.Get. ErrKeyNotFound = badger.ErrKeyNotFound // ErrTxnTooBig is returned if too many writes are fit into a single transaction. ErrTxnTooBig = badger.ErrTxnTooBig // ErrConflict is returned when a transaction conflicts with another transaction. This can happen if // the read rows had been updated concurrently by another transaction. ErrConflict = badger.ErrConflict // ErrReadOnlyTxn is returned if an update function is called on a read-only transaction. ErrReadOnlyTxn = badger.ErrReadOnlyTxn // ErrDiscardedTxn is returned if a previously discarded transaction is re-used. ErrDiscardedTxn = badger.ErrDiscardedTxn // ErrEmptyKey is returned if an empty key is passed on an update function. ErrEmptyKey = badger.ErrEmptyKey // ErrRetry is returned when a log file containing the value is not found. // This usually indicates that it may have been garbage collected, and the // operation needs to be retried. ErrRetry = badger.ErrRetry // ErrThresholdZero is returned if threshold is set to zero, and value log GC is called. // In such a case, GC can't be run. ErrThresholdZero = badger.ErrThresholdZero // ErrNoRewrite is returned if a call for value log GC doesn't result in a log file rewrite. ErrNoRewrite = badger.ErrNoRewrite // ErrRejected is returned if a value log GC is called either while another GC is running, or // after DB::Close has been called. ErrRejected = badger.ErrRejected // ErrInvalidRequest is returned if the user request is invalid. ErrInvalidRequest = badger.ErrInvalidRequest // ErrManagedTxn is returned if the user tries to use an API which isn't // allowed due to external management of transactions, when using ManagedDB. ErrManagedTxn = badger.ErrManagedTxn // ErrInvalidDump if a data dump made previously cannot be loaded into the database. ErrInvalidDump = badger.ErrInvalidDump // ErrZeroBandwidth is returned if the user passes in zero bandwidth for sequence. ErrZeroBandwidth = badger.ErrZeroBandwidth // ErrInvalidLoadingMode is returned when opt.ValueLogLoadingMode option is not // within the valid range ErrInvalidLoadingMode = badger.ErrInvalidLoadingMode // ErrReplayNeeded is returned when opt.ReadOnly is set but the // database requires a value log replay. ErrReplayNeeded = badger.ErrReplayNeeded // ErrWindowsNotSupported is returned when opt.ReadOnly is used on Windows ErrWindowsNotSupported = badger.ErrWindowsNotSupported // ErrTruncateNeeded is returned when the value log gets corrupt, and requires truncation of // corrupt data to allow Badger to run properly. ErrTruncateNeeded = badger.ErrTruncateNeeded )
View Source
var ( // DefaultOptions . DefaultOptions = badger.DefaultOptions // DefaultIteratorOptions . DefaultIteratorOptions = badger.DefaultIteratorOptions )
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB .
func (*DB) GetMergeOperator ¶
GetMergeOperator .
func (*DB) GetSequence ¶
GetSequence .
func (*DB) UpdateWith ¶
func (db *DB) UpdateWith(fn func(txn *Txn) error, beforeCommit BeforeCommit) error
UpdateWith .
type ManagedDB ¶
ManagedDB .
func (*ManagedDB) GetSequence ¶
GetSequence .
func (*ManagedDB) NewTransaction ¶
NewTransaction .
type Txn ¶
Txn .
func (*Txn) CommitAtWith ¶
func (txn *Txn) CommitAtWith(commitTs uint64, beforeCommit BeforeCommit, callback func(error)) error
CommitAtWith .
func (*Txn) CommitWith ¶
func (txn *Txn) CommitWith(beforeCommit BeforeCommit, callback func(error)) error
CommitWith .
func (*Txn) NewIterator ¶
func (txn *Txn) NewIterator(opt IteratorOptions) *badger.Iterator
NewIterator .
func (*Txn) SetWithDiscard ¶
SetWithDiscard .
func (*Txn) SetWithMeta ¶
SetWithMeta .
Click to show internal directories.
Click to hide internal directories.