lmdbdb

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2026 License: UNKNOWN, Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMapSize int64 = 1 << 40

DefaultMapSize is the default maximum database size (1 TB).

View Source
const (
	LMDBBackend db.BackendType = "lmdbdb"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LMDB

type LMDB struct {
	// contains filtered or unexported fields
}

LMDB wraps an lmdb.Env + DBI handle.

func NewLMDB

func NewLMDB(name, dir string) (*LMDB, error)

NewLMDB opens an LMDB database with production defaults.

func NewLMDBWithOptions

func NewLMDBWithOptions(name, dir string, mapSize int64, extraFlags uint) (*LMDB, error)

NewLMDBWithOptions opens an LMDB database with custom map size and flags. Extra flags are OR'd with the base flags (NoMetaSync | WriteMap | NoReadahead).

func (*LMDB) Close

func (l *LMDB) Close() error

func (*LMDB) Delete

func (l *LMDB) Delete(key []byte) error

func (*LMDB) DeleteSync

func (l *LMDB) DeleteSync(key []byte) error

func (*LMDB) Get

func (l *LMDB) Get(key []byte) ([]byte, error)

func (*LMDB) Has

func (l *LMDB) Has(key []byte) (bool, error)

func (*LMDB) Iterator

func (l *LMDB) Iterator(start, end []byte) (db.Iterator, error)

Iterator implements db.DB. The caller MUST call Close() on the returned iterator to release resources. Close() on the LMDB will block until all iterators are closed.

func (*LMDB) NewBatch

func (l *LMDB) NewBatch() db.Batch

func (*LMDB) NewBatchWithSize

func (l *LMDB) NewBatchWithSize(_ int) db.Batch

func (*LMDB) Print

func (l *LMDB) Print() error

func (*LMDB) ReverseIterator

func (l *LMDB) ReverseIterator(start, end []byte) (db.Iterator, error)

ReverseIterator implements db.DB. The caller MUST call Close() on the returned iterator to release resources. Close() on the LMDB will block until all iterators are closed.

func (*LMDB) Set

func (l *LMDB) Set(key, value []byte) error

func (*LMDB) SetSync

func (l *LMDB) SetSync(key, value []byte) error

func (*LMDB) Stats

func (l *LMDB) Stats() map[string]string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL