keyvalue

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVBatchRepo

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

KVBatchRepo implement BatchRepo

func NewKVBatchRepo

func NewKVBatchRepo(batchDAO dao.KeyValueDAO) *KVBatchRepo

NewKVBatchRepo new KVBatchRepo instance

func (*KVBatchRepo) GetAllBatchStatuses

func (repo *KVBatchRepo) GetAllBatchStatuses() []types.BatchStatus

GetAllBatchStatuses get all batches

func (*KVBatchRepo) ReplaceBatch

func (repo *KVBatchRepo) ReplaceBatch(from *big.Int, newTo *big.Int) error

ReplaceBatch replace a batch with new "to"

func (*KVBatchRepo) UpdateBatch

func (repo *KVBatchRepo) UpdateBatch(batch types.BatchStatus) error

UpdateBatch update a batch

type KVIndexRepo

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

KVIndexRepo implementation of IndexRepo

func NewKVIndexRepo

func NewKVIndexRepo(addressDAO dao.KeyValueDAO, blockDAO dao.KeyValueDAO) *KVIndexRepo

NewKVIndexRepo create an instance of KVIndexRepo

func (*KVIndexRepo) DeleteOldBlocks

func (repo *KVIndexRepo) DeleteOldBlocks(untilTime *big.Int) (int, error)

DeleteOldBlocks delete blocks where CreatedAt < untilTime

func (*KVIndexRepo) GetBlocks

func (repo *KVIndexRepo) GetBlocks(blockNumber string, rows int, start int) (int, []types.BlockIndex)

GetBlocks by blockNumber. blockNumber = blank => latest block

func (*KVIndexRepo) GetFirstBlock

func (repo *KVIndexRepo) GetFirstBlock() (types.BlockIndex, error)

GetFirstBlock first saved block in newHead block DB

func (*KVIndexRepo) GetLastBlock

func (repo *KVIndexRepo) GetLastBlock() (types.BlockIndex, error)

GetLastBlock latest saved block in newHead block DB

func (*KVIndexRepo) GetTotalTransaction added in v1.0.0

func (repo *KVIndexRepo) GetTotalTransaction(address string, fromTime time.Time, toTime time.Time) int

GetTotalTransaction get total transaction of an account

func (*KVIndexRepo) GetTransactionByAddress

func (repo *KVIndexRepo) GetTransactionByAddress(address string, rows int, start int, fromTime time.Time, toTime time.Time) (int, []types.AddressIndex)

GetTransactionByAddress main thing for this indexer

func (*KVIndexRepo) HandleReorg

func (repo *KVIndexRepo) HandleReorg(blockTime *big.Int, reorgAddresses []types.AddressSequence) error

HandleReorg handle reorg scenario: get block again

func (*KVIndexRepo) SaveAddressIndex

func (repo *KVIndexRepo) SaveAddressIndex(addressIndex []*types.AddressIndex) error

SaveAddressIndex save to address db

func (*KVIndexRepo) SaveBlockIndex

func (repo *KVIndexRepo) SaveBlockIndex(blockIndex *types.BlockIndex) error

SaveBlockIndex save to block db

func (*KVIndexRepo) Store

func (repo *KVIndexRepo) Store(addressIndex []*types.AddressIndex, blockIndex *types.BlockIndex, isBatch bool) error

Store implements IndexRepo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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