processors

package
v0.0.0-...-c9303cd Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

processors package contains the most commonly used processors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVPrinter

type CSVPrinter struct {
	Filename string
	// contains filtered or unexported fields
}

CSVPrinter prints ledger entries to a file or stdout (when Filename is empty). Can be used both for processing state and ledgers. The state output matches the format of data in diamnet-core DB so can be used for diff-testing the state readers.

func (*CSVPrinter) Name

func (p *CSVPrinter) Name() string

func (*CSVPrinter) ProcessLedger

func (p *CSVPrinter) ProcessLedger(ctx context.Context, store *pipeline.Store, r io.LedgerReader, w io.LedgerWriter) error

func (*CSVPrinter) ProcessState

func (p *CSVPrinter) ProcessState(ctx context.Context, store *pipeline.Store, r io.StateReader, w io.StateWriter) error

func (*CSVPrinter) Reset

func (n *CSVPrinter) Reset()

type EntryTypeFilter

type EntryTypeFilter struct {
	Type xdr.LedgerEntryType
	// contains filtered or unexported fields
}

EntryTypeFilter is a pipeline.StateProcessor that filters out all entries that are not of type `Type`.

func (*EntryTypeFilter) Name

func (p *EntryTypeFilter) Name() string

func (*EntryTypeFilter) ProcessState

func (p *EntryTypeFilter) ProcessState(ctx context.Context, store *pipeline.Store, r io.StateReader, w io.StateWriter) error

func (*EntryTypeFilter) Reset

func (n *EntryTypeFilter) Reset()

type RootProcessor

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

RootProcessor is useful when a pipeline needs to be split stream into multiple branches right away. This processor is a no-op - just passes the data to all children.

func (*RootProcessor) Name

func (p *RootProcessor) Name() string

func (*RootProcessor) ProcessLedger

func (p *RootProcessor) ProcessLedger(ctx context.Context, store *pipeline.Store, r io.LedgerReader, w io.LedgerWriter) error

func (*RootProcessor) ProcessState

func (p *RootProcessor) ProcessState(ctx context.Context, store *pipeline.Store, r io.StateReader, w io.StateWriter) error

func (*RootProcessor) Reset

func (n *RootProcessor) Reset()

type StatusLogger

type StatusLogger struct {
	N int
	// contains filtered or unexported fields
}

StatusLogger prints number of processed entries every N entries.

func (*StatusLogger) Name

func (p *StatusLogger) Name() string

func (*StatusLogger) ProcessState

func (p *StatusLogger) ProcessState(ctx context.Context, store *pipeline.Store, r io.StateReader, w io.StateWriter) error

func (*StatusLogger) Reset

func (n *StatusLogger) Reset()

Jump to

Keyboard shortcuts

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