store

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 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
}

func NewTestKV added in v0.1.0

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

NewTestKV returns a KV store for testing purposes.

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