v0.0.0-...-a5a65f0 Latest Latest

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

Go to latest
Published: Dec 30, 2017 License: Apache-2.0 Imports: 4 Imported by: 0



Package buffer provides a sorted.KeyValue implementation that buffers one KeyValue implementation in front of an another. It's used for cases such as reindexing where you need a KeyValue but it doesn't need to be flushed and consistent until the end.



This section is empty.


This section is empty.


This section is empty.


type KeyValue

type KeyValue struct {
	// contains filtered or unexported fields

func New

func New(buffer, backing sorted.KeyValue, maxBufferBytes int64) *KeyValue

New returnes a sorted.KeyValue implementation that adds a Flush method to flush the buffer to the backing storage. A flush will also be performed when maxBufferBytes are reached. If maxBufferBytes <= 0, no automatic flushing is performed.

func (*KeyValue) BeginBatch

func (kv *KeyValue) BeginBatch() sorted.BatchMutation

func (*KeyValue) Close

func (kv *KeyValue) Close() error

func (*KeyValue) CommitBatch

func (kv *KeyValue) CommitBatch(bm sorted.BatchMutation) error

func (*KeyValue) Delete

func (kv *KeyValue) Delete(key string) error

func (*KeyValue) Find

func (kv *KeyValue) Find(start, end string) sorted.Iterator

func (*KeyValue) Flush

func (kv *KeyValue) Flush() error

func (*KeyValue) Get

func (kv *KeyValue) Get(key string) (string, error)

func (*KeyValue) Set

func (kv *KeyValue) Set(key, value string) error

Jump to

Keyboard shortcuts

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