memorykv

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: BSD-2-Clause Imports: 7 Imported by: 0

README

Memory KV

This implements a common interfaces for simple key value stores in memory.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BucketAddKey

func BucketAddKey(bucket libkv.BucketName, key []byte) []byte

func BucketRemoveKey

func BucketRemoveKey(bucket libkv.BucketName, key []byte) []byte

func BucketToPrefix

func BucketToPrefix(bucket libkv.BucketName) []byte

func IsTransactionOpen

func IsTransactionOpen(ctx context.Context) bool

func NewBucket

func NewBucket() libkv.Bucket

func NewItem

func NewItem(
	key []byte,
	valueGetter ValueGetter,
) libkv.Item

func NewIterator

func NewIterator(
	keys []string,
	valueGetter ValueGetter,
) libkv.Iterator

func NewIteratorReverse

func NewIteratorReverse(
	keys []string,
	valueGetter ValueGetter,
) libkv.Iterator

func NewTx

func NewTx() libkv.Tx

func OpenMemory

func OpenMemory(ctx context.Context) (libkv.DB, error)

func SetOpenState

func SetOpenState(ctx context.Context) context.Context

Types

type DB

type DB interface {
	libkv.DB
}

func NewDB

func NewDB() DB

type ValueGetter

type ValueGetter interface {
	Get(ctx context.Context, key []byte) (libkv.Item, error)
}

Jump to

Keyboard shortcuts

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