Documentation ¶
Index ¶
- Constants
- Variables
- func NewBackendError(err error) error
- func RunTestItemCopy(t *testing.T, idb IDB)
- func RunTestIterator(t *testing.T, idb IDB)
- func RunTestReverseIterator(t *testing.T, idb IDB)
- func RunTestShardFind(t *testing.T, idb IDB)
- func RunTestUpdateView(t *testing.T, idb IDB)
- type BackendError
- type DB
- type IDB
- type IItem
- type IIterator
- type ITxn
- type Item
- type Iterator
- type IteratorOptions
- type Txn
- func (rTxn *Txn) CanWrite() bool
- func (rTxn *Txn) Delete(key []byte) error
- func (rTxn *Txn) Get(key []byte) (*Item, error)
- func (rTxn *Txn) NewIterator(opts *IteratorOptions) *Iterator
- func (rTxn *Txn) NextShardSeq() []byte
- func (rTxn *Txn) Set(key []byte, val []byte) error
- func (rTxn *Txn) TrimDomain(s []byte) []byte
Constants ¶
View Source
const ( IteratorForward uint8 = 0 IteratorBackward uint8 = 1 )
View Source
const ( RangeOpen uint8 = 0x00 RangeClose uint8 = 0x11 RangeSClose uint8 = 0x01 // Start Open RangeEClose uint8 = 0x10 // End Open )
Variables ¶
View Source
var ( ErrZeroBandwidth = errors.New("Bandwidth cannot be zero") ErrEmptyKey = errors.New("Key cannot be empty") // ErrKeyNotFound is returned when key isn't found on a txn.Get. ErrKeyNotFound = errors.New("Key not found") // ErrConflict is returned when a transaction conflicts with another transaction. This can happen if // the read rows had been updated concurrently by another transaction. ErrConflict = errors.New("Transaction Conflict. Please retry") // ErrReadOnlyTxn is returned if an update function is called on a read-only transaction. ErrReadOnlyTxn = errors.New("No sets or deletes are allowed in a read-only transaction") // ErrDiscardedTxn is returned if a previously discarded transaction is re-used. ErrDiscardedTxn = errors.New("This transaction has been discarded. Create a new one") )
Functions ¶
func NewBackendError ¶
func RunTestItemCopy ¶
func RunTestIterator ¶
func RunTestReverseIterator ¶
func RunTestShardFind ¶
func RunTestUpdateView ¶
Types ¶
type BackendError ¶
type BackendError struct {
Original error
}
func (BackendError) Error ¶
func (e BackendError) Error() string
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator is a high level abstraction of a prefix iterator that can go forward or backwards. It requires a prefix, start or end key, limit, and offset.
func (*Iterator) Item ¶
Item reuses a shared item struct. You need to copy values before moving on to the next item.
func (*Iterator) TrimPrefix ¶
type IteratorOptions ¶
type IteratorOptions struct { StartKey []byte EndKey []byte RangeType uint8 Offset int Count int Prefetch int Prefix []byte }
min must less or equal than max
range type:
close: [min, max] open: (min, max) sclose: [min, max) eclose: (min, max]
type Txn ¶
type Txn struct { ITxn // contains filtered or unexported fields }
func (*Txn) NewIterator ¶
func (rTxn *Txn) NewIterator(opts *IteratorOptions) *Iterator
count < 0, unlimit. offset must >= 0, if < 0, will get nothing.
func (*Txn) NextShardSeq ¶
func (*Txn) TrimDomain ¶
Click to show internal directories.
Click to hide internal directories.