keyvalue

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func NewStore added in v0.3.0

func NewStore(path string) *storeImpl

func SafeKey added in v0.3.0

func SafeKey(iter Iterator) []byte

func SafeValue added in v0.3.0

func SafeValue(iter Iterator) []byte

Types

type Batch added in v0.3.0

type Batch interface {
	Delete(key []byte)
	Put(key, val []byte)
	Reset()
}

type BloomFilterParams added in v0.3.0

type BloomFilterParams struct {
	// N is how many items will be added to the filter.
	N int
	// FalsePositiveProbability is acceptable false positive rate {0..1}.
	FalsePositiveProbability float64
	// Bloom store
	Store store
}

func NewBloomFilterParams added in v0.3.0

func NewBloomFilterParams(N int, FalsePositiveProbability float64, store store) BloomFilterParams

type CacheParams added in v0.3.0

type CacheParams struct {
	Size int
}

type IterableKeyVal

type IterableKeyVal interface {
	KeyValue
	NewKeyIterator(prefix []byte) (Iterator, error)
}

type Iterator

type Iterator interface {
	Key() []byte
	Value() []byte
	Next() bool
	Error() error
	Release()
}

type KeyVal

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

func NewKeyVal

func NewKeyVal(path string, params KeyValParams) (*KeyVal, error)

func (*KeyVal) Close added in v0.3.0

func (k *KeyVal) Close() error

func (*KeyVal) Delete

func (k *KeyVal) Delete(key []byte) error

func (*KeyVal) Flush

func (k *KeyVal) Flush(b1 Batch) error

func (*KeyVal) Get

func (k *KeyVal) Get(key []byte) ([]byte, error)

func (*KeyVal) Has

func (k *KeyVal) Has(key []byte) (bool, error)

func (*KeyVal) NewBatch added in v0.3.0

func (k *KeyVal) NewBatch() (Batch, error)

func (*KeyVal) NewKeyIterator

func (k *KeyVal) NewKeyIterator(prefix []byte) (Iterator, error)

func (*KeyVal) Put

func (k *KeyVal) Put(key, val []byte) error

type KeyValParams added in v0.3.0

type KeyValParams struct {
	CacheParams
	BloomFilterParams
	WriteBuffer         int
	CompactionTableSize int
	CompactionTotalSize int
}

type KeyValue

type KeyValue interface {
	NewBatch() (Batch, error)
	Has(key []byte) (bool, error)
	Put(key, val []byte) error
	Get(key []byte) ([]byte, error)
	Delete(key []byte) error
	Flush(batch Batch) error
	Close() error
}

type NoOpStore added in v0.3.0

type NoOpStore struct {
}

func (NoOpStore) WithPath added in v0.3.0

func (NoOpStore) WithPath(string)

Jump to

Keyboard shortcuts

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