keyvalue

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewBloomFilterStub added in v0.8.8

func NewBloomFilterStub(params BloomFilterParams) bloomFilterStub

func NewStore added in v0.3.0

func NewStore(path string) *storeImpl

func SafeKey added in v0.3.0

func SafeKey(k KeyInter) []byte

func SafeValue added in v0.3.0

func SafeValue(k ValueInter) []byte

Types

type Batch added in v0.3.0

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

type BloomFilter added in v0.8.8

type BloomFilter interface {
	Params() BloomFilterParams
	io.WriterTo
	// contains filtered or unexported methods
}

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
	// Disable bloom filter.
	Disable bool
}

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
	Prev() bool

	First() bool
	Last() bool

	Error() error
	Release()
}

type KeyInter added in v0.6.0

type KeyInter interface {
	Key() []byte
}

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
	OpenFilesCacheCapacity 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)

type ValueInter added in v0.6.0

type ValueInter interface {
	Value() []byte
}

Jump to

Keyboard shortcuts

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