db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const CName = "consensus.db"

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeReceiver

type ChangeReceiver func(logId []byte, records []consensus.Record)

type Service

type Service interface {
	// AddLog adds new log db
	AddLog(ctx context.Context, log consensus.Log) (err error)
	// AddRecord adds new record to existing log
	// returns consensuserr.ErrConflict if record didn't match or log not found
	AddRecord(ctx context.Context, logId []byte, record consensus.Record) (err error)
	// FetchLog gets log by id
	FetchLog(ctx context.Context, logId []byte) (log consensus.Log, err error)
	// SetChangeReceiver sets the receiver for updates, it must be called before app.Run stage
	SetChangeReceiver(receiver ChangeReceiver) (err error)
	app.ComponentRunnable
}

func New

func New() Service

Jump to

Keyboard shortcuts

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