storage

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

View Source
const (
	KeyLength = 32 // Total bytes used for keys
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValueDB

type KeyValueDB interface {
	Close() error                                // Returns an error if the close fails
	InitDB(filepath string) error                // Sets up the database, returns error if it fails
	Get(key [KeyLength]byte) (value []byte)      // Get key from database, on not found, error returns nil
	Put(key [KeyLength]byte, value []byte) error // Put the value in the database, throws an error if fails
	PutBatch(TXs []TX) error                     // End and commit a batch of transactions
}

type TX

type TX struct {
	Key   []byte
	Value []byte
	Meta  byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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