store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 0 Imported by: 7

Documentation

Overview

Package store defines the primitives of a simple key/value storage.

Documentation Last Review: 08.10.2020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Readable

type Readable interface {
	Get(key []byte) ([]byte, error)
}

Readable is the interface for a readable store.

type Snapshot

type Snapshot interface {
	Readable
	Writable
}

Snapshot is a state of the store that can be read and write independently. A write is applied only to the snapshot reference.

type Transaction

type Transaction interface {
	// OnCommit adds a callback to be executed after the transaction
	// successfully commits.
	OnCommit(func())
}

Transaction is a generic interface that store implementations can use to provide atomicity.

type Writable

type Writable interface {
	Set(key []byte, value []byte) error

	// Delete deletes a given key.
	// It can return an error if deleting from a read-only store
	// No error is returned if the key does not exist.
	Delete(key []byte) error
}

Writable is the interface for a writable store.

Directories

Path Synopsis
Package hashtree defines the specialization of the store as a Merkle tree.
Package hashtree defines the specialization of the store as a Merkle tree.
binprefix
Package binprefix implements the hash tree interface by following the merkle binary prefix tree algorithm.
Package binprefix implements the hash tree interface by following the merkle binary prefix tree algorithm.
kv
Package kv defines the abstraction for a key/value database.
Package kv defines the abstraction for a key/value database.
controller
Package controller implements a CLI controller for the key/value database.
Package controller implements a CLI controller for the key/value database.

Jump to

Keyboard shortcuts

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