package store

import "go.dedis.ch/dela/core/store"

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

Documentation Last Review: 08.10.2020

Index

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.

Source Files

store.go

Directories

PathSynopsis
core/store/hashtreePackage hashtree defines the specialization of the store as a Merkle tree.
core/store/hashtree/binprefixPackage binprefix implements the hash tree interface by following the merkle binary prefix tree algorithm.
core/store/kvPackage kv defines the abstraction for a key/value database.
core/store/kv/controllerPackage controller implements a CLI controller for the key/value database.
core/store/prefixed
Version
v0.1.0 (latest)
Published
Apr 10, 2024
Platform
linux/amd64
Last checked
1 month ago

Tools for package owners.