mindreader

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 29 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTestModeDSN added in v1.11.3

func ParseTestModeDSN(dsn string) (endpoint string, apiKey string, apiToken string, insecure bool, plaintext bool, err error)

ParseTestModeDSN parses the DSN format: http(s)://host:port[?insecure=true][&apiKey=key] Also checks FIREHOSE_API_KEY and FIREHOSE_API_TOKEN environment variables

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,
	testModeComparator *TestModeComparator,
	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()

type TestModeComparator added in v1.11.3

type TestModeComparator struct {
	// contains filtered or unexported fields
}

func NewTestModeComparator added in v1.11.3

func NewTestModeComparator(config *TestModeConfig, registry *fcproto.Registry, sanitizer func(pbbstream *pbbstream.Block) *pbbstream.Block, logger *zap.Logger) (*TestModeComparator, error)

func (*TestModeComparator) AgainstDSN added in v1.11.3

func (c *TestModeComparator) AgainstDSN() string

func (*TestModeComparator) Close added in v1.11.3

func (c *TestModeComparator) Close() error

func (*TestModeComparator) CompareBlock added in v1.11.3

func (c *TestModeComparator) CompareBlock(ctx context.Context, testingBlock *pbbstream.Block) error

func (*TestModeComparator) DiffOutput added in v1.11.3

func (c *TestModeComparator) DiffOutput() string

func (*TestModeComparator) MarshalLogObject added in v1.11.3

func (c *TestModeComparator) MarshalLogObject(enc zapcore.ObjectEncoder) error

type TestModeConfig added in v1.11.3

type TestModeConfig struct {
	Enabled    bool
	AgainstDSN string
	DiffOutput string
}

Jump to

Keyboard shortcuts

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