kv

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type KVStore

type KVStore interface {
	KVWriter
	BeginTransaction() Transaction
}

KVStore is a key-value store that supports transactions.

type KVWriter

type KVWriter interface {
	Get(key []byte) ([]byte, error)
	Set(key []byte, value []byte) error
	Delete(key []byte) error
}

KVWriter is a subset of the KVStore interface that only allows for CRUD operations.

type Transaction

type Transaction interface {
	KVWriter
	Commit() error
	Discard()
}

Transaction is a read-write transaction on a KVStore.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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