memory

package
v0.15.16 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

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) Put

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

func (*Database) Update

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

func (*Database) View

func (d *Database) View(fn func(db.Snapshot) error) error

func (*Database) WithListener

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

Jump to

Keyboard shortcuts

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