kvstore

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package kvstore is the key/value substrate port (ADR-0019): get/put/delete/list over opaque string keys and []byte values. The service facade (internal/services/kv) supplies the tenant-prefixed key (<namespace>/<binding>/<key>); the driver is namespace-agnostic. V1 ships an in-memory driver; JetStream / database-layer drivers are deferred behind this port.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckStorePrefix added in v0.11.0

func CheckStorePrefix(op, prefix string) error

CheckStorePrefix refuses a per-store export prefix (ADR-0209 Decision 7) that is empty, lacks the trailing "/" or starts with the NUL of a driver's reserved keys.

Types

type KV

type KV interface {
	// Get returns the value for key and whether it exists. A missing key is
	// (nil, false, nil) — not an error.
	Get(ctx context.Context, key string) (value []byte, found bool, err error)
	// Put stores value under key (overwriting any existing value).
	Put(ctx context.Context, key string, value []byte) error
	// Delete removes key; deleting a missing key is a no-op (no error).
	Delete(ctx context.Context, key string) error
	// List returns the keys that start with prefix.
	List(ctx context.Context, prefix string) (keys []string, err error)
}

KV is the key/value port. Errors are api/fault; every method is ctx-first.

Directories

Path Synopsis
Package badger is the durable kvstore.KV driver (ADR-0066): a pure-Go Badger instance (separate from the metastore's, ADR-0065) with a single-writer group-commit gateway and per-store DropPrefix teardown.
Package badger is the durable kvstore.KV driver (ADR-0066): a pure-Go Badger instance (separate from the metastore's, ADR-0065) with a single-writer group-commit gateway and per-store DropPrefix teardown.
Package kvstorecontract is the shared conformance suite for the kvstore.KV port (ADR-0019): Run asserts put/get/overwrite/delete/list/missing-key against any driver.
Package kvstorecontract is the shared conformance suite for the kvstore.KV port (ADR-0019): Run asserts put/get/overwrite/delete/list/missing-key against any driver.
Package memory is the in-memory kvstore.KV driver (ADR-0019): a mutex-guarded map, for dev/e2e/tests.
Package memory is the in-memory kvstore.KV driver (ADR-0019): a mutex-guarded map, for dev/e2e/tests.

Jump to

Keyboard shortcuts

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