Versions in this module Expand all Collapse all v1 v1.8.0 Jan 12, 2022 v1.7.0 Jan 3, 2022 Changes in this version + const ACK + const BEL + const BS + const CAN + const CR + const DC1 + const DC2 + const DC3 + const DC4 + const DEL + const DLE + const EM + const ENQ + const EOT + const ESC + const ETB + const ETX + const FF + const FS + const GS + const LF + const LevelDebug + const LevelError + const LevelFatal + const LevelInfo + const LevelOff + const LevelWarn + const NAK + const NUL + const RS + const SI + const SO + const SOH + const STX + const SUB + const SYN + const TAB + const US + const VT + var ErrBadChecksum = errors.New("lsmtree: bad checksum") + var ErrBadKey = errors.New("lsmtree: bad key") + var ErrBadValue = errors.New("lsmtree: bad value") + var ErrFileClosed = errors.New("lsmtree: file is closed") + var ErrFlushThreshold = errors.New("lsmtree: flush threshold has been reached") + var ErrFoundTombstone = errors.New("lsmtree: found tombstone or empty value") + var ErrIncompleteSet = errors.New("lsmtree: incomplete batch or set") + var ErrKeyNotFound = errors.New("lsmtree: key not found") + var ErrKeyTooLarge = errors.New("lsmtree: key too large") + var ErrNilEntry = errors.New("lsmtree: error got nil entry") + var ErrNilIndex = errors.New("lsmtree: error got nil index") + var ErrNoDataFound = errors.New("lsmtree: no data found") + var ErrNotFound = errors.New("lsmtree: entry not found") + var ErrReadingEntry = errors.New("lsmtree: error reading entry") + var ErrValueTooLarge = errors.New("lsmtree: value too large") + var ErrWritingEntry = errors.New("lsmtree: error write entry") + var Tombstone = []byte + func FileIsOpen(fd *os.File) bool + func GetTempFileForTesting(t *testing.T, fn func(file *os.File)) + func LevelText(level logLevel) string + func SizeInKB(size int64) int64 + func SizeInMB(size int64) int64 + type Batch struct + Entries []*Entry + func NewBatch() *Batch + func (b *Batch) Discard() + func (b *Batch) Len() int + func (b *Batch) Less(i, j int) bool + func (b *Batch) Size() int64 + func (b *Batch) Swap(i, j int) + func (b *Batch) Write(key, value []byte) error + type Entry struct + CRC uint32 + Key []byte + Value []byte + func (e *Entry) Size() int64 + func (e *Entry) String() string + type EntryHeader struct + type Index struct + Key []byte + Offset int64 + func (i *Index) String() string + type Info struct + func (info *Info) String() string + type LSMTree struct + func OpenLSMTree(options *Options) (*LSMTree, error) + func (lsm *LSMTree) Close() error + func (lsm *LSMTree) Del(k []byte) error + func (lsm *LSMTree) Get(k []byte) ([]byte, error) + func (lsm *LSMTree) GetBatch(keys ...[]byte) (*Batch, error) + func (lsm *LSMTree) GetInfo() *Info + func (lsm *LSMTree) Has(k []byte) (bool, error) + func (lsm *LSMTree) Put(k, v []byte) error + func (lsm *LSMTree) PutBatch(b *Batch) error + func (lsm *LSMTree) Sync() error + type Logger struct + func (l *Logger) Debug(s string, a ...interface{}) + func (l *Logger) Error(s string, a ...interface{}) + func (l *Logger) Fatal(s string, a ...interface{}) + func (l *Logger) Info(s string, a ...interface{}) + func (l *Logger) Warn(s string, a ...interface{}) + type Options struct + BaseDir string + LoggingLevel uint8 + SyncOnWrite bool + func DefaultOptions(base string) *Options