store

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockStore

type BlockStore interface {
	StoreBlock(structs.BlockWithMeta) error

	GetLatestBlock(ctx context.Context, blx structs.BlockWithMeta) (structs.Block, error)
	GetBlockForTime(ctx context.Context, blx structs.BlockWithMeta, time time.Time) (structs.Block, bool, error)

	BlockContinuityCheck(ctx context.Context, blx structs.BlockWithMeta, startHeight, endHeight uint64) ([][2]uint64, error)
	BlockTransactionCheck(ctx context.Context, blx structs.BlockWithMeta, startHeight, endHeight uint64) ([]uint64, error)

	GetBlocksHeightsWithNumTx(ctx context.Context, blx structs.BlockWithMeta, startHeight, endHeight uint64) ([][2]uint64, error)
}

type DBDriver

type DBDriver interface {
	TransactionStore
	BlockStore
	FlushBuffered
}

type DataStore

type DataStore interface {
	TransactionStore
	BlockStore
}

type FlushBuffered

type FlushBuffered interface {
	Flush() error
}

type Store

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

func New

func New(driver DBDriver) *Store

func (*Store) BlockContinuityCheck

func (s *Store) BlockContinuityCheck(ctx context.Context, blx structs.BlockWithMeta, startHeight, endHeight uint64) ([][2]uint64, error)

func (*Store) BlockTransactionCheck

func (s *Store) BlockTransactionCheck(ctx context.Context, blx structs.BlockWithMeta, startHeight, endHeight uint64) ([]uint64, error)

func (*Store) GetBlockForTime added in v0.1.2

func (s *Store) GetBlockForTime(ctx context.Context, blx structs.BlockWithMeta, time time.Time) (structs.Block, bool, error)

func (*Store) GetBlocksHeightsWithNumTx added in v0.0.2

func (s *Store) GetBlocksHeightsWithNumTx(ctx context.Context, blx structs.BlockWithMeta, startHeight, endHeight uint64) ([][2]uint64, error)

func (*Store) GetLatestBlock

func (s *Store) GetLatestBlock(ctx context.Context, blx structs.BlockWithMeta) (structs.Block, error)

func (*Store) GetLatestTransaction

func (s *Store) GetLatestTransaction(ctx context.Context, in structs.TransactionWithMeta) (out structs.Transaction, err error)

func (*Store) GetTransactions

func (s *Store) GetTransactions(ctx context.Context, tsearch params.TransactionSearch) ([]structs.Transaction, error)

func (*Store) GetTransactionsHeightsWithTxCount added in v0.0.2

func (s *Store) GetTransactionsHeightsWithTxCount(ctx context.Context, blx structs.BlockWithMeta, startHeight, endHeight uint64) ([][2]uint64, error)

func (*Store) Run

func (s *Store) Run(ctx context.Context, dur time.Duration)

func (*Store) StoreBlock

func (s *Store) StoreBlock(bl structs.BlockWithMeta) error

func (*Store) StoreTransaction

func (s *Store) StoreTransaction(tx structs.TransactionWithMeta) error

func (*Store) StoreTransactions

func (s *Store) StoreTransactions(txs []structs.TransactionWithMeta) error

type TransactionStore

type TransactionStore interface {
	StoreTransaction(structs.TransactionWithMeta) error
	StoreTransactions([]structs.TransactionWithMeta) error

	GetTransactions(ctx context.Context, tsearch params.TransactionSearch) ([]structs.Transaction, error)

	GetLatestTransaction(ctx context.Context, tx structs.TransactionWithMeta) (structs.Transaction, error)

	GetTransactionsHeightsWithTxCount(ctx context.Context, blx structs.BlockWithMeta, startHeight, endHeight uint64) ([][2]uint64, error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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