Documentation ¶
Index ¶
- Variables
- func MultiGet(kvreader KVReader, keys [][]byte) ([][]byte, error)
- func Register(k interface{}, c Constructor)
- type ConfigType
- type Constructor
- type EmulatedBatch
- type EmulatedMerge
- type KVBatch
- type KVBatchOptions
- type KVIterator
- type KVReader
- type KVRegistry
- type KVStore
- type KVWriter
- type MergeOperator
- type OptConfig
- type OptFilePath
- type OptMergeOperator
- type Option
- type Setter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotRegistered = fmt.Errorf("not registered.")
Functions ¶
func MultiGet ¶
MultiGet is a helper function to retrieve mutiple keys from a KVReader, and might be used by KVStore implementations that don't have a native multi-get facility.
func Register ¶
func Register(k interface{}, c Constructor)
Types ¶
type ConfigType ¶
type ConfigType map[string]interface{}
type Constructor ¶
type EmulatedBatch ¶
type EmulatedBatch struct { Ops []*op Merger *EmulatedMerge }
func NewEmulatedBatch ¶
func NewEmulatedBatch(mo MergeOperator) *EmulatedBatch
func (*EmulatedBatch) Close ¶
func (b *EmulatedBatch) Close() error
func (*EmulatedBatch) Delete ¶
func (b *EmulatedBatch) Delete(key []byte)
func (*EmulatedBatch) Merge ¶
func (b *EmulatedBatch) Merge(key, val []byte)
func (*EmulatedBatch) Reset ¶
func (b *EmulatedBatch) Reset()
func (*EmulatedBatch) Set ¶
func (b *EmulatedBatch) Set(key, val []byte)
type EmulatedMerge ¶
func NewEmulatedMerge ¶
func NewEmulatedMerge(mo MergeOperator) *EmulatedMerge
func (*EmulatedMerge) Merge ¶
func (m *EmulatedMerge) Merge(key, val []byte)
type KVBatchOptions ¶
type KVIterator ¶
type KVReader ¶
type KVReader interface { Get(key []byte) ([]byte, error) MultiGet(keys [][]byte) ([][]byte, error) PrefixIterator(prefix []byte) KVIterator PrefixIterator0(prefix []byte) KVIterator RangeIterator(start, end []byte) KVIterator RangeIterator0(start, end []byte) KVIterator ReversePrefixIterator(prefix []byte) KVIterator ReverseRangeIterator(start, end []byte) KVIterator Close() error }
type KVRegistry ¶
type KVRegistry struct {
// contains filtered or unexported fields
}
func (*KVRegistry) Register ¶
func (this *KVRegistry) Register(k interface{}, c Constructor)
type MergeOperator ¶
type MergeOperator interface { // FullMerge the full sequence of operands on top of the existingValue // if no value currently exists, existingValue is nil // return the merged value, and success/failure FullMerge(key, existingValue []byte, operands [][]byte) ([]byte, bool) // Partially merge these two operands. // If partial merge cannot be done, return nil,false, which will defer // all processing until the FullMerge is done. PartialMerge(key, leftOperand, rightOperand []byte) ([]byte, bool) // Name returns an identifier for the operator Name() string }
type OptConfig ¶
type OptConfig struct{ ConfigType }
type OptFilePath ¶
type OptFilePath struct{ FilePath string }
type OptMergeOperator ¶
type OptMergeOperator struct{ MergeOperator }
Directories ¶
Path | Synopsis |
---|---|
Package gtreap provides an in-memory implementation of the KVStore interfaces using the gtreap balanced-binary treap, copy-on-write data structure.
|
Package gtreap provides an in-memory implementation of the KVStore interfaces using the gtreap balanced-binary treap, copy-on-write data structure. |
Click to show internal directories.
Click to hide internal directories.