storewrapper

package module
v0.0.0-...-54b452a Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultChunkSize = 1024 * 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KVStore

type KVStore struct {
	types.KVStore
	ChunkSize int
}

func NewKVStore

func NewKVStore(store types.KVStore, chunkSize int) *KVStore

Create a wrapper around existing store

func (*KVStore) DeleteW

func (k *KVStore) DeleteW(keySrc []byte) (parts int, err error)

Delete all parts of stored value

func (*KVStore) GetW

func (k *KVStore) GetW(keySrc []byte) (res []byte, err error)

Get all parts of stored value

func (*KVStore) HasW

func (k *KVStore) HasW(keySrc []byte) (parts int, ok bool, err error)

Check if store has value; return number of parts, hasValue, error

func (*KVStore) SetW

func (k *KVStore) SetW(keySrc, valueSrc []byte) (parts int, err error)

Add or update value in store; if update - delete old parts; return parts stored, error

Jump to

Keyboard shortcuts

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