bbolt_engine

package
v0.0.0-...-14d575d Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func Open

func Open(path string) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) ReadTransaction

func (db *DB) ReadTransaction(fn func(tx port.EngineReadTransaction) error) error

func (*DB) Stats

func (db *DB) Stats() (stats model.DatabaseStats, err error)

func (*DB) WriteTransaction

func (db *DB) WriteTransaction(fn func(tx port.EngineWriteTransaction) error) error

WriteTransaction executes the given function in a read transaction that collects all database updates into an operation log that will be executed at the end of the transaction execution as one transaction. This method is designed to allow more concurrent write transactions due to less time spend waiting between the different write operations. If no writes are made, the update transaction is omitted.

type NoopCursor

type NoopCursor struct {
}

func (*NoopCursor) First

func (nc *NoopCursor) First() (key []byte, value []byte)

func (*NoopCursor) Last

func (nc *NoopCursor) Last() (key []byte, value []byte)

func (*NoopCursor) Next

func (nc *NoopCursor) Next() (key []byte, value []byte)

func (*NoopCursor) Prev

func (nc *NoopCursor) Prev() (key []byte, value []byte)

func (*NoopCursor) Seek

func (nc *NoopCursor) Seek(seek []byte) (key []byte, value []byte)

type ReadTransaction

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

func NewReadTransaction

func NewReadTransaction(tx *bbolt.Tx) *ReadTransaction

func (*ReadTransaction) BucketStats

func (tx *ReadTransaction) BucketStats(bucket []byte) *model.IndexStats

func (*ReadTransaction) Cursor

func (tx *ReadTransaction) Cursor(bucket []byte) port.EngineCursor

func (*ReadTransaction) Get

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

func (*ReadTransaction) Sequence

func (tx *ReadTransaction) Sequence(bucket []byte) uint64

type WriteTransaction

type WriteTransaction struct {
	ReadTransaction
	// contains filtered or unexported fields
}

WriteTransaction will store all write operations in a log an execute them all at once in a transaction. The aim is to unblock write transactions to the database by packing the transactions into a log.

func NewWriteTransaction

func NewWriteTransaction(readTx *bbolt.Tx) *WriteTransaction

func (*WriteTransaction) Commit

func (t *WriteTransaction) Commit(tx *bbolt.Tx) error

func (*WriteTransaction) Delete

func (t *WriteTransaction) Delete(bucket, k []byte)

func (*WriteTransaction) DeleteBucket

func (t *WriteTransaction) DeleteBucket(bucket []byte)

func (*WriteTransaction) EnsureBucket

func (t *WriteTransaction) EnsureBucket(bucket []byte)

func (*WriteTransaction) Put

func (t *WriteTransaction) Put(bucket, k, v []byte)

func (*WriteTransaction) PutWithReusedSequence

func (t *WriteTransaction) PutWithReusedSequence(bucket, k, v []byte, fn port.KeyWithSeq)

func (*WriteTransaction) PutWithSequence

func (t *WriteTransaction) PutWithSequence(bucket, k, v []byte, fn port.KeyWithSeq)

Jump to

Keyboard shortcuts

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