inmemory

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryDB

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

InMemoryDB implements an ephemeral in-memory db.Database.

func New

func New(_ db.Options) (*InMemoryDB, error)

New returns a new in-memory database. Options are ignored.

func (*InMemoryDB) Close

func (d *InMemoryDB) Close() error

func (*InMemoryDB) Compact

func (d *InMemoryDB) Compact() error

func (*InMemoryDB) Get

func (d *InMemoryDB) Get(key []byte) ([]byte, error)

func (*InMemoryDB) Iterate

func (d *InMemoryDB) Iterate(prefix []byte, callback func(key, value []byte) bool) error

func (*InMemoryDB) WriteTx

func (d *InMemoryDB) WriteTx() db.WriteTx

type WriteTx

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

func (*WriteTx) Apply

func (tx *WriteTx) Apply(other db.WriteTx) error

func (*WriteTx) Commit

func (tx *WriteTx) Commit() error

func (*WriteTx) Delete

func (tx *WriteTx) Delete(key []byte) error

func (*WriteTx) Discard

func (tx *WriteTx) Discard()

func (*WriteTx) Get

func (tx *WriteTx) Get(key []byte) ([]byte, error)

func (*WriteTx) Iterate

func (tx *WriteTx) Iterate(prefix []byte, callback func(k, v []byte) bool) error

func (*WriteTx) Set

func (tx *WriteTx) Set(key, value []byte) error

Jump to

Keyboard shortcuts

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