mindreader

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archiver

type Archiver struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

func NewArchiver

func NewArchiver(
	startBlock uint64,
	oneblockSuffix string,
	localOneBlocksStore dstore.Store,
	remoteOneBlocksStore dstore.Store,
	logger *zap.Logger,
	tracer logging.Tracer,
) *Archiver

func (*Archiver) Start

func (a *Archiver) Start(ctx context.Context)

func (*Archiver) StoreBlock

func (a *Archiver) StoreBlock(ctx context.Context, block *pbbstream.Block) error

type CloseableConsoleReader added in v1.1.0

type CloseableConsoleReader interface {
	ConsolerReader

	Close() error
}

type ConsolerReader

type ConsolerReader interface {
	ReadBlock() (obj *pbbstream.Block, err error)
	Done() <-chan interface{}
}

type ConsolerReaderFactory

type ConsolerReaderFactory func(lines chan string) (ConsolerReader, error)

type FileUploader

type FileUploader struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

func NewFileUploader

func NewFileUploader(localStore dstore.Store, destinationStore dstore.Store, logger *zap.Logger) *FileUploader

func (*FileUploader) Start

func (fu *FileUploader) Start(ctx context.Context)

type MindReaderPlugin

type MindReaderPlugin struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

func NewMindReaderPlugin

func NewMindReaderPlugin(
	oneBlocksStoreURL string,
	workingDirectory string,
	consoleReaderFactory ConsolerReaderFactory,
	startBlockNum uint64,
	stopBlockNum uint64,
	channelCapacity int,
	headBlockUpdater nodeManager.HeadBlockUpdater,
	shutdownFunc func(error),
	oneBlockSuffix string,
	blockStreamServer *blockstream.Server,
	zlogger *zap.Logger,
	tracer logging.Tracer,
) (*MindReaderPlugin, error)

NewMindReaderPlugin initiates its own: * ConsoleReader (from given Factory) * Archiver (from archive store params) * Shutter

func (*MindReaderPlugin) LastSeenBlock

func (p *MindReaderPlugin) LastSeenBlock() bstream.BlockRef

GetMindreaderLineChannel is a marker method that `superviser.Superviser` uses to determine if `logplugin.LogPlugin` is an actual mindreader plugin without depending on the `mindreader` package in which case it would create an import cycle.

The `superviser.Superviser` defines `type mindreaderPlugin interface { LastSeenBlockNum() bstream.BlockRef }` which is respected. This is a trick to avoid circual dependency in imports.

func (*MindReaderPlugin) Launch

func (p *MindReaderPlugin) Launch()

func (*MindReaderPlugin) LogLine

func (p *MindReaderPlugin) LogLine(in string)

LogLine receives log line and write it to "pipe" of the local console reader

func (*MindReaderPlugin) Name

func (p *MindReaderPlugin) Name() string

func (*MindReaderPlugin) OnBlockWritten

func (p *MindReaderPlugin) OnBlockWritten(callback nodeManager.OnBlockWritten)

func (MindReaderPlugin) Stop

func (p MindReaderPlugin) Stop()

Jump to

Keyboard shortcuts

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