package
0.13.6
Repository: https://github.com/cryptix-network/cryptixd.git
Documentation: pkg.go.dev

# README

database

ISC License GoDoc

Package database provides a database for cryptixd.

Overview

This package provides a database layer to store and retrieve data in a simple and efficient manner.

The current backend is ffldb, which makes use of leveldb, flat files, and strict checksums in key areas to ensure data integrity.

Implementors of additional backends are required to implement the following interfaces:

DataAccessor

This defines the common interface by which data gets accessed in a generic cryptixd database. Both the Database and the Transaction interfaces (see below) implement it.

Database

This defines the interface of a database that can begin transactions and close itself.

Transaction

This defines the interface of a generic cryptixd database transaction.

Note: Transactions provide data consistency over the state of the database as it was when the transaction started. There is NO guarantee that if one puts data into the transaction then it will be available to get within the same transaction.

Cursor

This iterates over database entries given some bucket.

# Packages

No description provided by the author

# Functions

IsNotFoundError checks whether an error is an ErrNotFound.
MakeBucket creates a new Bucket using the given path of buckets.

# Variables

ErrNotFound denotes that the requested item was not found in the database.

# Structs

Bucket is a helper type meant to combine buckets and sub-buckets that can be used to create database keys and prefix-based cursors.
Key is a helper type meant to combine prefix and suffix into a single database key.

# Interfaces

Cursor iterates over database entries given some bucket.
DataAccessor defines the common interface by which data gets accessed in a generic cryptixd database.
Database defines the interface of a database that can begin transactions and close itself.
Transaction defines the interface of a generic cryptixd database transaction.