buffered

package
v0.5.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedKVStore

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

BufferedKVStore is a KVStore backed by a given KVStoreReader. Writes are cached in-memory; reads are delegated to the backing store for unmodified keys.

func NewBufferedKVStore

func NewBufferedKVStore(r kv.KVStoreReader) *BufferedKVStore

func NewBufferedKVStoreForMutations added in v1.0.3

func NewBufferedKVStoreForMutations(r kv.KVStoreReader, m *Mutations) *BufferedKVStore

func (*BufferedKVStore) Clone

func (b *BufferedKVStore) Clone() *BufferedKVStore

func (*BufferedKVStore) DangerouslyDumpToDict

func (b *BufferedKVStore) DangerouslyDumpToDict() dict.Dict

DangerouslyDumpToDict returns a Dict with the whole contents of the backing store + applied mutations.

func (*BufferedKVStore) DangerouslyDumpToString

func (b *BufferedKVStore) DangerouslyDumpToString() string

iterates over all key-value pairs in KVStore

func (*BufferedKVStore) Del added in v1.0.3

func (b *BufferedKVStore) Del(key kv.Key)

func (*BufferedKVStore) Get added in v1.0.3

func (b *BufferedKVStore) Get(key kv.Key) ([]byte, error)

func (*BufferedKVStore) Has added in v1.0.3

func (b *BufferedKVStore) Has(key kv.Key) (bool, error)

func (*BufferedKVStore) Iterate added in v1.0.3

func (b *BufferedKVStore) Iterate(prefix kv.Key, f func(key kv.Key, value []byte) bool) error

func (*BufferedKVStore) IterateKeys added in v1.0.3

func (b *BufferedKVStore) IterateKeys(prefix kv.Key, f func(key kv.Key) bool) error

func (*BufferedKVStore) IterateKeysSorted added in v1.0.3

func (b *BufferedKVStore) IterateKeysSorted(prefix kv.Key, f func(key kv.Key) bool) error

func (*BufferedKVStore) IterateSorted added in v1.0.3

func (b *BufferedKVStore) IterateSorted(prefix kv.Key, f func(key kv.Key, value []byte) bool) error

func (*BufferedKVStore) MustGet

func (b *BufferedKVStore) MustGet(key kv.Key) []byte

func (*BufferedKVStore) MustHas

func (b *BufferedKVStore) MustHas(key kv.Key) bool

func (*BufferedKVStore) MustIterate

func (b *BufferedKVStore) MustIterate(prefix kv.Key, f func(key kv.Key, value []byte) bool)

func (*BufferedKVStore) MustIterateKeys

func (b *BufferedKVStore) MustIterateKeys(prefix kv.Key, f func(key kv.Key) bool)

func (*BufferedKVStore) MustIterateKeysSorted

func (b *BufferedKVStore) MustIterateKeysSorted(prefix kv.Key, f func(key kv.Key) bool)

func (*BufferedKVStore) MustIterateSorted

func (b *BufferedKVStore) MustIterateSorted(prefix kv.Key, f func(key kv.Key, value []byte) bool)

func (*BufferedKVStore) Mutations

func (b *BufferedKVStore) Mutations() *Mutations

func (*BufferedKVStore) Set added in v1.0.3

func (b *BufferedKVStore) Set(key kv.Key, value []byte)

type Mutations added in v0.2.0

type Mutations struct {
	Sets map[kv.Key][]byte
	Dels map[kv.Key]struct{}
}

Mutations is a set of mutations: one for each key It provides a deterministic serialization

func NewMutations added in v0.2.0

func NewMutations() *Mutations

func (*Mutations) ApplyTo added in v0.2.0

func (ms *Mutations) ApplyTo(w kv.KVWriter)

func (*Mutations) Bytes added in v0.2.0

func (ms *Mutations) Bytes() []byte

func (*Mutations) Clone added in v0.2.0

func (ms *Mutations) Clone() *Mutations

func (*Mutations) Contains added in v0.2.0

func (ms *Mutations) Contains(k kv.Key) bool

func (*Mutations) Del added in v0.2.0

func (ms *Mutations) Del(k kv.Key)

func (*Mutations) DelsSorted added in v0.2.0

func (ms *Mutations) DelsSorted() []kv.Key

func (*Mutations) Dump added in v0.3.0

func (ms *Mutations) Dump() string

func (*Mutations) Get added in v0.2.0

func (ms *Mutations) Get(k kv.Key) ([]byte, bool)

func (*Mutations) IsEmpty added in v0.2.0

func (ms *Mutations) IsEmpty() bool

func (*Mutations) Read added in v0.2.0

func (ms *Mutations) Read(r io.Reader) error

func (*Mutations) Set added in v0.2.0

func (ms *Mutations) Set(k kv.Key, v []byte)

func (*Mutations) SetsSorted added in v0.2.0

func (ms *Mutations) SetsSorted() kv.Items

func (*Mutations) Write added in v0.2.0

func (ms *Mutations) Write(w io.Writer) error

Jump to

Keyboard shortcuts

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