kvstore

package
v0.47.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoOp = fmt.Errorf("noop")

Functions

This section is empty.

Types

type KVStore

type KVStore interface {
	// Get retrieves a value for a given key. Returns nil if not found.
	Get(key []byte) ([]byte, error)

	// Set stores a value for a given key
	Set(key []byte, value []byte) error

	// Delete removes a key and its value
	Delete(key []byte) error

	// Close releases any resources held by the store
	Close() error

	// Update atomically modifies a value for a given key.
	// The function f receives the current value (nil if not found)
	// and returns the new value to be set.
	// If f returns nil, the key is deleted.
	Update(key []byte, f func([]byte) ([]byte, error)) error
}

KVStore is a simple key-value store interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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