processors

package
v0.0.0-...-fb9541f Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IngestUpdateDatabase = PipelineContextKey("IngestUpdateDatabase")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetStatSet

type AssetStatSet map[assetStatKey]*assetStatValue

AssetStatSet represents a collection of asset stats

func (AssetStatSet) Add

func (s AssetStatSet) Add(trustLine xdr.TrustLineEntry) error

Add updates the set with a trustline entry from a history archive snapshot if the trustline is authorized.

func (AssetStatSet) AddDelta

func (s AssetStatSet) AddDelta(asset xdr.Asset, deltaBalance int64, deltaAccounts int32) error

AddDelta adds a delta balance and delta accounts to a given asset.

func (AssetStatSet) All

func (s AssetStatSet) All() []history.ExpAssetStat

All returns a list of all `history.ExpAssetStat` contained within the set

func (AssetStatSet) Remove

func (s AssetStatSet) Remove(assetType xdr.AssetType, assetCode string, assetIssuer string) (history.ExpAssetStat, bool)

Remove deletes an asset stat from the set

type ContextFilter

type ContextFilter struct {
	Key PipelineContextKey
}

ContextFilter writes read objects only if a given key is present in the pipline context.

func (*ContextFilter) Name

func (p *ContextFilter) Name() string

func (*ContextFilter) ProcessLedger

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

func (*ContextFilter) ProcessState

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

func (*ContextFilter) Reset

func (p *ContextFilter) Reset()

type DatabaseProcessor

type DatabaseProcessor struct {
	AccountsQ     history.QAccounts
	DataQ         history.QData
	SignersQ      history.QSigners
	OffersQ       history.QOffers
	TrustLinesQ   history.QTrustLines
	AssetStatsQ   history.QAssetStats
	LedgersQ      history.QExpLedgers
	Action        DatabaseProcessorActionType
	IngestVersion int
	// AssetStatSet is used in TrustLines processor
	AssetStatSet AssetStatSet
}

DatabaseProcessor is a processor (both state and ledger) that's responsible for persisting ledger data used in expingest in a database. It's possible to create multiple procesors of this type but they all should share the same *history.Q object to share a common transaction. `Action` defines what each processor is responsible for.

func (*DatabaseProcessor) Name

func (p *DatabaseProcessor) Name() string

func (*DatabaseProcessor) ProcessLedger

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

func (*DatabaseProcessor) ProcessState

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

func (*DatabaseProcessor) Reset

func (p *DatabaseProcessor) Reset()

type DatabaseProcessorActionType

type DatabaseProcessorActionType string
const (
	Accounts          DatabaseProcessorActionType = "Accounts"
	AccountsForSigner DatabaseProcessorActionType = "AccountsForSigner"
	Data              DatabaseProcessorActionType = "Data"
	Offers            DatabaseProcessorActionType = "Offers"
	TrustLines        DatabaseProcessorActionType = "TrustLines"
	Ledgers           DatabaseProcessorActionType = "Ledgers"
	All               DatabaseProcessorActionType = "All"
)

type OrderbookProcessor

type OrderbookProcessor struct {
	OrderBookGraph *orderbook.OrderBookGraph
}

OrderbookProcessor is a processor (both state and ledger) that's responsible for updating orderbook graph with new/updated/removed offers. Orderbook graph can be later used for path finding.

func (*OrderbookProcessor) Name

func (p *OrderbookProcessor) Name() string

func (*OrderbookProcessor) ProcessLedger

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

func (*OrderbookProcessor) ProcessState

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

func (*OrderbookProcessor) Reset

func (p *OrderbookProcessor) Reset()

type PipelineContextKey

type PipelineContextKey string

Jump to

Keyboard shortcuts

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