memdb

package
v0.0.0-...-66aa405 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginRo

func BeginRo(tb testing.TB, db kv.RoDB) kv.Tx

func BeginRw

func BeginRw(tb testing.TB, db kv.RwDB) kv.RwTx

func New

func New(tmpDir string) kv.RwDB

func NewDownloaderDB

func NewDownloaderDB(tmpDir string) kv.RwDB

func NewPoolDB

func NewPoolDB(tmpDir string) kv.RwDB

func NewSentryDB

func NewSentryDB(tmpDir string) kv.RwDB

func NewTestDB

func NewTestDB(tb testing.TB) kv.RwDB

func NewTestDownloaderDB

func NewTestDownloaderDB(tb testing.TB) kv.RwDB

func NewTestPoolDB

func NewTestPoolDB(tb testing.TB) kv.RwDB

func NewTestPoolTx

func NewTestPoolTx(tb testing.TB) (kv.RwDB, kv.RwTx)

func NewTestSentryTx

func NewTestSentryTx(tb testing.TB) (kv.RwDB, kv.RwTx)

func NewTestSentrylDB

func NewTestSentrylDB(tb testing.TB) kv.RwDB

func NewTestTx

func NewTestTx(tb testing.TB) (kv.RwDB, kv.RwTx)

Types

type MemoryMutation

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

func NewMemoryBatch

func NewMemoryBatch(tx kv.Tx, tmpDir string) *MemoryMutation

NewMemoryBatch - starts in-mem batch

Common pattern:

batch := NewMemoryBatch(db, tmpDir) defer batch.Rollback() ... some calculations on `batch` batch.Commit()

func (*MemoryMutation) Append

func (m *MemoryMutation) Append(table string, key []byte, value []byte) error

func (*MemoryMutation) AppendDup

func (m *MemoryMutation) AppendDup(table string, key []byte, value []byte) error

func (*MemoryMutation) BucketSize

func (m *MemoryMutation) BucketSize(bucket string) (uint64, error)

func (*MemoryMutation) ClearBucket

func (m *MemoryMutation) ClearBucket(bucket string) error

func (*MemoryMutation) Close

func (m *MemoryMutation) Close()

func (*MemoryMutation) CollectMetrics

func (m *MemoryMutation) CollectMetrics()

func (*MemoryMutation) Commit

func (m *MemoryMutation) Commit() error

func (*MemoryMutation) CreateBucket

func (m *MemoryMutation) CreateBucket(bucket string) error

func (*MemoryMutation) Cursor

func (m *MemoryMutation) Cursor(bucket string) (kv.Cursor, error)

Cursor creates a new cursor (the real fun begins here)

func (*MemoryMutation) CursorDupSort

func (m *MemoryMutation) CursorDupSort(bucket string) (kv.CursorDupSort, error)

Cursor creates a new cursor (the real fun begins here)

func (*MemoryMutation) DBSize

func (m *MemoryMutation) DBSize() (uint64, error)

func (*MemoryMutation) Delete

func (m *MemoryMutation) Delete(table string, k []byte) error

func (*MemoryMutation) DropBucket

func (m *MemoryMutation) DropBucket(bucket string) error

func (*MemoryMutation) ExistsBucket

func (m *MemoryMutation) ExistsBucket(bucket string) (bool, error)

func (*MemoryMutation) Flush

func (m *MemoryMutation) Flush(tx kv.RwTx) error

func (*MemoryMutation) ForAmount

func (m *MemoryMutation) ForAmount(bucket string, prefix []byte, amount uint32, walker func(k, v []byte) error) error

func (*MemoryMutation) ForEach

func (m *MemoryMutation) ForEach(bucket string, fromPrefix []byte, walker func(k, v []byte) error) error

func (*MemoryMutation) ForPrefix

func (m *MemoryMutation) ForPrefix(bucket string, prefix []byte, walker func(k, v []byte) error) error

func (*MemoryMutation) GetOne

func (m *MemoryMutation) GetOne(table string, key []byte) ([]byte, error)

Can only be called from the worker thread

func (*MemoryMutation) Has

func (m *MemoryMutation) Has(table string, key []byte) (bool, error)

Has return whether a key is present in a certain table.

func (*MemoryMutation) IncrementSequence

func (m *MemoryMutation) IncrementSequence(bucket string, amount uint64) (uint64, error)

func (*MemoryMutation) Last

func (m *MemoryMutation) Last(table string) ([]byte, []byte, error)

func (*MemoryMutation) ListBuckets

func (m *MemoryMutation) ListBuckets() ([]string, error)

func (*MemoryMutation) Prefix

func (m *MemoryMutation) Prefix(table string, prefix []byte) (iter.KV, error)

func (*MemoryMutation) Put

func (m *MemoryMutation) Put(table string, k, v []byte) error

func (*MemoryMutation) Range

func (m *MemoryMutation) Range(table string, fromPrefix, toPrefix []byte) (iter.KV, error)

func (*MemoryMutation) RangeAscend

func (m *MemoryMutation) RangeAscend(table string, fromPrefix, toPrefix []byte, limit int) (iter.KV, error)

func (*MemoryMutation) RangeDescend

func (m *MemoryMutation) RangeDescend(table string, fromPrefix, toPrefix []byte, limit int) (iter.KV, error)

func (*MemoryMutation) RangeDupSort

func (m *MemoryMutation) RangeDupSort(table string, key []byte, fromPrefix, toPrefix []byte, asc order.By, limit int) (iter.KV, error)

func (*MemoryMutation) ReadSequence

func (m *MemoryMutation) ReadSequence(bucket string) (uint64, error)

func (*MemoryMutation) Rollback

func (m *MemoryMutation) Rollback()

func (*MemoryMutation) RwCursor

func (m *MemoryMutation) RwCursor(bucket string) (kv.RwCursor, error)

Cursor creates a new cursor (the real fun begins here)

func (*MemoryMutation) RwCursorDupSort

func (m *MemoryMutation) RwCursorDupSort(bucket string) (kv.RwCursorDupSort, error)

Cursor creates a new cursor (the real fun begins here)

func (*MemoryMutation) Stream

func (m *MemoryMutation) Stream(table string, fromPrefix, toPrefix []byte) (iter.KV, error)

func (*MemoryMutation) StreamAscend

func (m *MemoryMutation) StreamAscend(table string, fromPrefix, toPrefix []byte, limit int) (iter.KV, error)

func (*MemoryMutation) StreamDescend

func (m *MemoryMutation) StreamDescend(table string, fromPrefix, toPrefix []byte, limit int) (iter.KV, error)

func (*MemoryMutation) UpdateTxn

func (m *MemoryMutation) UpdateTxn(tx kv.Tx)

func (*MemoryMutation) ViewID

func (m *MemoryMutation) ViewID() uint64

type NextType

type NextType int
const (
	Normal NextType = iota
	Dup
	NoDup
)

Jump to

Keyboard shortcuts

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