Versions in this module Expand all Collapse all v1 v1.0.0 Apr 19, 2023 Changes in this version + const DEFAULT_BLOCK_PROGRESS + const LIVE_BLOCK_PROGRESS + var FlushCount = metrics.NewCounter("substreams_sink_postgres_store_flush_count", ...) + var FlushDuration = metrics.NewCounter("substreams_sink_postgres_store_flush_duration", ...) + var FlushedEntriesCount = metrics.NewCounter("substreams_sink_postgres_flushed_entries_count", ...) + func RegisterMetrics() + type Config struct + BlockRange string + ClientConfig *client.SubstreamsClientConfig + DBLoader *db.Loader + FlushInterval int + InfiniteRetry bool + IrreversibleOnly bool + LiveBlockTimeDelta time.Duration + OutputModule *pbsubstreams.Module + OutputModuleHash manifest.ModuleHash + OutputModuleName string + Pkg *pbsubstreams.Package + SubstreamsDevelopmentMode bool + UndoBufferSize int + type PostgresSinker struct + ClientConfig *client.SubstreamsClientConfig + DBLoader *db.Loader + FlushInterval int + InfiniteRetry bool + IrreversibleOnly bool + LivenessTracker *sink.LivenessChecker + OutputModule *pbsubstreams.Module + OutputModuleHash manifest.ModuleHash + OutputModuleName string + Pkg *pbsubstreams.Package + SubstreamsDevelopmentMode bool + UndoBufferSize int + func New(config *Config, logger *zap.Logger, tracer logging.Tracer) (*PostgresSinker, error) + func (s *PostgresSinker) Run(ctx context.Context) error + func (s *PostgresSinker) Start(ctx context.Context) error + func (s *PostgresSinker) Stop(ctx context.Context, err error) + type Stats struct + func NewStats(logger *zap.Logger) *Stats + func (s *Stats) Close() + func (s *Stats) RecordBlock(block bstream.BlockRef) + func (s *Stats) Start(each time.Duration)