embeddedkvs

package
v0.0.0-...-8ff35f7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVS

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

func New

func New(ctx context.Context, path string) (*KVS, error)

New instantiates KVS.

func (*KVS) Close

func (k *KVS) Close() error

Close closes KVS.

func (*KVS) ForEach

func (k *KVS) ForEach(fn func(key string, value []byte) error) error

ForEach executes a function for each key/value pair in KVS.

func (*KVS) GetMulti

func (k *KVS) GetMulti(ctx context.Context, keys []string, fn func(key string, value []byte) error) error

GetMulti calls |fn| in parallel for cached entries.

func (*KVS) Set

func (k *KVS) Set(key string, value []byte) error

Set sets key/value to storage.

This should be called in parallel for efficient storing.

func (*KVS) SetMulti

func (k *KVS) SetMulti(fn func(set func(key string, value []byte) error) error) error

SetMulti receives callback that takes function which is used to set a key/value pair.

Jump to

Keyboard shortcuts

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