store

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresStore

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

func (*PostgresStore) CommitBlock

func (s *PostgresStore) CommitBlock(block uint64) error

func (*PostgresStore) GetMissingBlocks

func (s *PostgresStore) GetMissingBlocks(lowerBound uint64, upperBound uint64) (pgx.Rows, error)

func (*PostgresStore) GetSearchBounds

func (s *PostgresStore) GetSearchBounds(batchSize uint64, headCursor uint64, headBlockLag uint64) (uint64, uint64, error)

func (*PostgresStore) SetSearchLowerBound

func (s *PostgresStore) SetSearchLowerBound(newLowerBound uint64) error

type PostgresStoreOpts

type PostgresStoreOpts struct {
	DSN               string
	InitialLowerBound uint64
	Logg              logf.Logger
	Queries           goyesql.Queries
}

type Store

type Store[T any] interface {
	GetSearchBounds(batchSize uint64, headCursor uint64, headBlockLag uint64) (lowerBound uint64, upperBound uint64, err error)
	GetMissingBlocks(lowerBound uint64, upperBound uint64) (missingBlocksIterable T, err error)
	SetSearchLowerBound(newLowerBound uint64) (err error)
	CommitBlock(block uint64) (err error)
}

Store defines indexer get and set queries. GetMissingBlocks returns a generic iterable.

func NewPostgresStore

func NewPostgresStore(o PostgresStoreOpts) (Store[pgx.Rows], error)

Jump to

Keyboard shortcuts

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