Documentation ¶
Index ¶
- type DB
- type NoopCursor
- type ReadTransaction
- type WriteTransaction
- func (t *WriteTransaction) Commit(tx *bbolt.Tx) error
- func (t *WriteTransaction) Delete(bucket, k []byte)
- func (t *WriteTransaction) DeleteBucket(bucket []byte)
- func (t *WriteTransaction) EnsureBucket(bucket []byte)
- func (t *WriteTransaction) Put(bucket, k, v []byte)
- func (t *WriteTransaction) PutWithReusedSequence(bucket, k, v []byte, fn port.KeyWithSeq)
- func (t *WriteTransaction) PutWithSequence(bucket, k, v []byte, fn port.KeyWithSeq)
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 (*DB) ReadTransaction ¶
func (db *DB) ReadTransaction(fn func(tx port.EngineReadTransaction) error) 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)
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) 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) 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)
Click to show internal directories.
Click to hide internal directories.