store

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInmem

func NewInmem() *inmemKV

func NewLevelDB

func NewLevelDB(dir string) (*leveldbKV, error)

Types

type KV

type KV interface {
	io.Closer

	Get(key []byte) ([]byte, error)
	MultiGet(keys ...[]byte) ([][]byte, error)

	Put(key, value []byte) error

	NewWriteBatch() WriteBatch
	CommitWriteBatch(batch WriteBatch) error

	Delete(key []byte) error

	Dir() string
}

func NewTestKV added in v0.1.0

func NewTestKV(t testing.TB, kv string, path string, opts ...TestKVOption) (KV, func())

NewTestKV returns a KV store for testing purposes.

type TestKVConfig added in v0.2.0

type TestKVConfig struct {
	RemoveExisting bool
}

type TestKVOption added in v0.2.0

type TestKVOption func(cfg *TestKVConfig)

func WithKeepExisting added in v0.2.0

func WithKeepExisting() TestKVOption

type WriteBatch

type WriteBatch interface {
	Put(key, value []byte)

	Clear()
	Count() int
	Destroy()
}

Jump to

Keyboard shortcuts

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