Versions in this module Expand all Collapse all v1 v1.5.100 Oct 10, 2019 v1.5.99 Oct 10, 2019 Changes in this version + const ManifestFilename + var DefaultIteratorOptions = IteratorOptions + var DefaultOptions = Options + var ErrConflict = errors.New("Transaction Conflict. Please retry") + var ErrDiscardedTxn = errors.New("This transaction has been discarded. Create a new one") + var ErrEmptyKey = errors.New("Key cannot be empty") + var ErrInvalidDump = errors.New("Data dump cannot be read") + var ErrInvalidLoadingMode = errors.New("Invalid ValueLogLoadingMode, must be FileIO or MemoryMap") + var ErrInvalidRequest = errors.New("Invalid request") + var ErrKeyNotFound = errors.New("Key not found") + var ErrManagedTxn = errors.New("Invalid API request. Not allowed to perform this action using ManagedDB") + var ErrNoRewrite = errors.New("Value log GC attempt didn't result in any cleanup") + var ErrReadOnlyTxn = errors.New("No sets or deletes are allowed in a read-only transaction") + var ErrRejected = errors.New("Value log GC request rejected") + var ErrReplayNeeded = errors.New("Database was not properly closed, cannot open read-only") + var ErrRetry = errors.New("Unable to find log file. Please retry") + var ErrThresholdZero = errors.New("Value log GC can't run because threshold is set to zero") + var ErrTruncateNeeded = errors.New("Value log truncate required to run DB. This might result in data loss.") + var ErrTxnTooBig = errors.New("Txn is too big to fit into one request") + var ErrValueLogSize = errors.New("Invalid ValueLogFileSize, must be between 1MB and 2GB") + var ErrValueThreshold = errors.New("Invalid ValueThreshold, must be lower than uint16.") + var ErrWindowsNotSupported = errors.New("Read-only mode is not supported on Windows") + var ErrZeroBandwidth = errors.New("Bandwidth must be greater than zero") + var LSMOnlyOptions = Options + type DB struct + func Open(opt Options) (db *DB, err error) + 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) *MergeOperator + func (db *DB) GetSequence(key []byte, bandwidth uint64) (*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() []TableInfo + func (db *DB) Update(fn func(txn *Txn) error) error + func (db *DB) View(fn func(txn *Txn) error) error + type Entry struct + ExpiresAt uint64 + Key []byte + UserMeta byte + Value []byte + type Item struct + func (item *Item) DiscardEarlierVersions() bool + func (item *Item) EstimatedSize() int64 + func (item *Item) ExpiresAt() uint64 + func (item *Item) IsDeletedOrExpired() bool + func (item *Item) Key() []byte + func (item *Item) KeyCopy(dst []byte) []byte + func (item *Item) String() string + func (item *Item) ToString() string + func (item *Item) UserMeta() byte + func (item *Item) Value() ([]byte, error) + func (item *Item) ValueCopy(dst []byte) ([]byte, error) + func (item *Item) Version() uint64 + type Iterator struct + func (it *Iterator) Close() + func (it *Iterator) Item() *Item + func (it *Iterator) Next() + func (it *Iterator) Rewind() + func (it *Iterator) Seek(key []byte) + func (it *Iterator) Valid() bool + func (it *Iterator) ValidForPrefix(prefix []byte) bool + type IteratorOptions struct + AllVersions bool + PrefetchSize int + PrefetchValues bool + Reverse bool + type ManagedDB struct + func OpenManaged(opts Options) (*ManagedDB, error) + func (db *ManagedDB) GetSequence(_ []byte, _ uint64) (*Sequence, error) + func (db *ManagedDB) NewTransaction(update bool) + func (db *ManagedDB) NewTransactionAt(readTs uint64, update bool) *Txn + type Manifest struct + Creations int + Deletions int + Levels []levelManifest + Tables map[uint64]tableManifest + func ReplayManifestFile(fp *os.File) (ret Manifest, truncOffset int64, err error) + type MergeFunc func(existing, val []byte) []byte + type MergeOperator struct + func (op *MergeOperator) Add(val []byte) error + func (op *MergeOperator) Get() ([]byte, error) + func (op *MergeOperator) Stop() + type Options struct + Dir string + DoNotCompact bool + LevelOneSize int64 + LevelSizeMultiplier int + MaxLevels int + MaxTableSize int64 + NumCompactors int + NumLevelZeroTables int + NumLevelZeroTablesStall int + NumMemtables int + NumVersionsToKeep int + ReadOnly bool + SyncWrites bool + TableLoadingMode options.FileLoadingMode + Truncate bool + ValueDir string + ValueLogFileSize int64 + ValueLogLoadingMode options.FileLoadingMode + ValueLogMaxEntries uint32 + ValueThreshold int + type Sequence struct + func (seq *Sequence) Next() (uint64, error) + func (seq *Sequence) Release() error + type TableInfo struct + ID uint64 + Left []byte + Level int + Right []byte + type Txn struct + func (txn *Txn) Commit(callback func(error)) error + func (txn *Txn) CommitAt(commitTs uint64, callback func(error)) error + func (txn *Txn) Delete(key []byte) error + func (txn *Txn) Discard() + func (txn *Txn) Get(key []byte) (item *Item, rerr error) + func (txn *Txn) NewIterator(opt IteratorOptions) *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