storage

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package storage contains low level interfaces and common structures for concrete ledger storage engine implementations

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound returns if record/index not found in storage.
	ErrNotFound = errors.New("storage object not found")
)

Functions

This section is empty.

Types

type Store added in v0.0.5

type Store interface {
	// SetCurrentPulse stores current pulse number in memory.
	SetCurrentPulse(record.PulseNum)
	// GetCurrentPulse returns current pulse number.
	GetCurrentPulse() record.PulseNum

	GetRecord(*record.Reference) (record.Record, error)
	SetRecord(record.Record) (*record.Reference, error)

	GetClassIndex(*record.Reference) (*index.ClassLifeline, error)
	SetClassIndex(*record.Reference, *index.ClassLifeline) error

	GetObjectIndex(*record.Reference) (*index.ObjectLifeline, error)
	SetObjectIndex(*record.Reference, *index.ObjectLifeline) error

	// GetDrop return Jet's drop by pulse number.
	GetDrop(record.PulseNum) (*jetdrop.JetDrop, error)
	// SetDrop gets previous JetDrop, saves and returns the new one
	// for provided PulseNum.
	SetDrop(record.PulseNum, *jetdrop.JetDrop) (*jetdrop.JetDrop, error)

	// SetEntropy stores given entropy for given pulse in storage.
	//
	// Entropy is used for calculating node roles.
	SetEntropy(record.PulseNum, []byte) error

	// GetEntropy returns entropy from storage for given pulse.
	//
	// Entropy is used for calculating node roles.
	GetEntropy(record.PulseNum) ([]byte, error)
}

Store represents append-only Ledger storage.

Directories

Path Synopsis
Package badgerdb contains ledger store implementation on top of BadgerDB engine.
Package badgerdb contains ledger store implementation on top of BadgerDB engine.
badgertestutils
Package badgertestutils provides sharable utils for testing BadgerDB store implementation.
Package badgertestutils provides sharable utils for testing BadgerDB store implementation.

Jump to

Keyboard shortcuts

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