repository

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IChainInfoRepository

type IChainInfoRepository interface {
	InsertChainInfo(chainName, chainID string, IsMainnet bool) (int64, error)
	SelectChainInfoIDByChainID(chainID string) (int64, error)
}

interface for about meta.chain_info table

type IIndexPointerRepository

type IIndexPointerRepository interface {
	InitializeIndexPointerByChainID(indexTableName, chainID string, startHeight int64) error
	GetLastIndexPointerByIndexTableName(indexTableName string, chainInfoID int64) (model.IndexPointer, error)
	CheckIndexpoinerAlreadyInitialized(indexTableName string, chainInfoID int64) (bool, error)
}

interface for about meta.index_pointer table

type IMetaRepository

type IMetaRepository interface {
	IChainInfoRepository
	IIndexPointerRepository
	IValidatorInfoRepository

	// common sql interface for partition tables
	CreatePartitionTable(IndexName, chainID string) error
	InitPartitionTablesByChainInfoID(IndexName, chainID string, latestHeight int64) error
}

common repo interface

func NewMetaRepository

func NewMetaRepository(indexerDB common.IndexerDB) IMetaRepository

New general repository constructor

type IValidatorInfoRepository

type IValidatorInfoRepository interface {
	CreateValidatorInfoPartitionTableByChainID(chainID string) error
	GetValidatorInfoListByChainInfoID(chainInfoID int64) (validatorInfoList []model.ValidatorInfo, err error)
	InsertValidatorInfoList(validatorInfoList []model.ValidatorInfo) error
	GetValidatorInfoListByMonikers(chainInfoID int64, monikers []string) ([]model.ValidatorInfo, error)
}

interface for about meta.validator_info table

type MetaRepository

type MetaRepository struct {
	*bun.DB
	// contains filtered or unexported fields
}

func (*MetaRepository) CheckIndexpoinerAlreadyInitialized

func (repo *MetaRepository) CheckIndexpoinerAlreadyInitialized(indexTableName string, chainInfoID int64) (bool, error)

func (*MetaRepository) CreatePartitionTable

func (repo *MetaRepository) CreatePartitionTable(IndexName, chainID string) error

Because of using chainInfoID, some users can use wrong chain_info_id about input chainID

func (*MetaRepository) CreateValidatorInfoPartitionTableByChainID

func (repo *MetaRepository) CreateValidatorInfoPartitionTableByChainID(chainID string) error

func (*MetaRepository) GetLastIndexPointerByIndexTableName

func (repo *MetaRepository) GetLastIndexPointerByIndexTableName(indexTableName string, chainInfoID int64) (model.IndexPointer, error)

func (*MetaRepository) GetValidatorInfoListByChainInfoID

func (repo *MetaRepository) GetValidatorInfoListByChainInfoID(chainInfoID int64) ([]model.ValidatorInfo, error)

func (*MetaRepository) GetValidatorInfoListByMonikers

func (repo *MetaRepository) GetValidatorInfoListByMonikers(chainInfoID int64, monikers []string) ([]model.ValidatorInfo, error)

func (*MetaRepository) InitPartitionTablesByChainInfoID

func (repo *MetaRepository) InitPartitionTablesByChainInfoID(indexName, chainID string, latestHeight int64) error

func (*MetaRepository) InitializeIndexPointerByChainID

func (repo *MetaRepository) InitializeIndexPointerByChainID(
	indexTableName, chainID string, startHeight int64,
) error

func (*MetaRepository) InsertChainInfo

func (repo *MetaRepository) InsertChainInfo(chainName, chainID string, isMainnet bool) (int64, error)

func (*MetaRepository) InsertValidatorInfoList

func (repo *MetaRepository) InsertValidatorInfoList(validatorInfoList []model.ValidatorInfo) error

func (*MetaRepository) SelectChainInfoIDByChainID

func (repo *MetaRepository) SelectChainInfoIDByChainID(chainID string) (int64, error)

Jump to

Keyboard shortcuts

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