memory

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Represents an in-memory key-value store. It is thread-safe.

func New

func New() *Database

func (*Database) Close

func (d *Database) Close() error

func (*Database) Copy added in v0.15.5

func (d *Database) Copy() *Database

Returns a deep Copy of the key-value store

func (*Database) Delete

func (d *Database) Delete(key []byte) error

func (*Database) DeleteRange

func (d *Database) DeleteRange(start, end []byte) error

func (*Database) Get

func (d *Database) Get(key []byte, cb func(value []byte) error) error

func (*Database) Has

func (d *Database) Has(key []byte) (bool, error)

func (*Database) Impl

func (d *Database) Impl() any

func (*Database) NewBatch

func (d *Database) NewBatch() db.Batch

func (*Database) NewBatchWithSize

func (d *Database) NewBatchWithSize(_ int) db.Batch

func (*Database) NewIndexedBatch

func (d *Database) NewIndexedBatch() db.IndexedBatch

func (*Database) NewIndexedBatchWithSize

func (d *Database) NewIndexedBatchWithSize(_ int) db.IndexedBatch

func (*Database) NewIterator

func (d *Database) NewIterator(prefix []byte, withUpperBound bool) (db.Iterator, error)

func (*Database) NewSnapshot

func (d *Database) NewSnapshot() db.Snapshot

func (*Database) Path added in v0.16.5

func (d *Database) Path() string

func (*Database) Put

func (d *Database) Put(key, value []byte) error

func (*Database) Update

func (d *Database) Update(fn func(db.IndexedBatch) error) error

func (*Database) WithListener

func (d *Database) WithListener(listener db.EventListener) db.KeyValueStore

func (*Database) Write added in v0.16.1

func (d *Database) Write(fn func(db.Batch) error) error

Jump to

Keyboard shortcuts

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