perkeep.org: perkeep.org/pkg/sorted/buffer Index | Files

package buffer

import "perkeep.org/pkg/sorted/buffer"

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.

Index

Package Files

buffer.go

type KeyValue Uses

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

func New Uses

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 Uses

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

func (*KeyValue) Close Uses

func (kv *KeyValue) Close() error

func (*KeyValue) CommitBatch Uses

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

func (*KeyValue) Delete Uses

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

func (*KeyValue) Find Uses

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

func (*KeyValue) Flush Uses

func (kv *KeyValue) Flush() error

func (*KeyValue) Get Uses

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

func (*KeyValue) Set Uses

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

Package buffer imports 4 packages (graph). Updated 2019-07-03. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).