consensusclient

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CName = "consensus.consensusclient"

Variables

View Source
var (
	ErrWatcherExists    = errors.New("watcher exists")
	ErrWatcherNotExists = errors.New("watcher not exists")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	// AddLog adds new log to consensus servers
	AddLog(ctx context.Context, logId string, rec *consensusproto.RawRecordWithId) (err error)
	// DeleteLog deletes the log from the consensus node
	DeleteLog(ctx context.Context, logId string) (err error)
	// AddRecord adds new record to consensus servers
	AddRecord(ctx context.Context, logId string, rec *consensusproto.RawRecord) (record *consensusproto.RawRecordWithId, err error)
	// Watch starts watching to given logId and calls watcher when any relative event received
	Watch(logId string, w Watcher) (err error)
	// UnWatch stops watching given logId and removes watcher
	UnWatch(logId string) (err error)
	app.ComponentRunnable
}

func New

func New() Service

type Watcher

type Watcher interface {
	AddConsensusRecords(recs []*consensusproto.RawRecordWithId)
	AddConsensusError(err error)
}

Watcher watches new events by specified logId

Directories

Path Synopsis
Package mock_consensusclient is a generated GoMock package.
Package mock_consensusclient is a generated GoMock package.

Jump to

Keyboard shortcuts

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