Documentation ¶
Overview ¶
processors package contains the most commonly used processors.
Index ¶
- type CSVPrinter
- type EntryTypeFilter
- type RootProcessor
- func (p *RootProcessor) Name() string
- func (p *RootProcessor) ProcessLedger(ctx context.Context, store *pipeline.Store, r io.LedgerReader, ...) error
- func (p *RootProcessor) ProcessState(ctx context.Context, store *pipeline.Store, r io.StateReader, w io.StateWriter) error
- func (n *RootProcessor) Reset()
- type StatusLogger
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
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
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
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