Documentation ¶
Index ¶
- Constants
- type CountResult
- type DBClient
- func (conn *DBClient) AddChainStatHour(chainStatHour *model.ChainStatHour) error
- func (conn *DBClient) BatchAddAddressTx(dbTx *gorm.DB, items []*model.AddressTxs) error
- func (conn *DBClient) BatchAddBalanceTx(dbTx *gorm.DB, items []*model.BalanceTxn) error
- func (conn *DBClient) BatchAddBalances(dbTx *gorm.DB, items []*model.Balances) error
- func (conn *DBClient) BatchAddInscription(dbTx *gorm.DB, ins []*model.Inscriptions) error
- func (conn *DBClient) BatchAddInscriptionStats(dbTx *gorm.DB, ins []*model.InscriptionsStats) error
- func (conn *DBClient) BatchAddTransaction(dbTx *gorm.DB, items []*model.Transaction) error
- func (conn *DBClient) BatchUpdateBalances(dbTx *gorm.DB, chain string, items []*model.Balances) error
- func (conn *DBClient) BatchUpdateInscription(dbTx *gorm.DB, chain string, items []*model.Inscriptions) error
- func (conn *DBClient) BatchUpdateInscriptionStats(dbTx *gorm.DB, chain string, items []*model.InscriptionsStats) error
- func (conn *DBClient) BatchUpdatesBySID(dbTx *gorm.DB, chain string, tblName string, fields map[string]string, ...) (error, int64)
- func (conn *DBClient) CountTickByChain(chain string) int64
- func (conn *DBClient) CreateInBatches(dbTx *gorm.DB, value interface{}, batchSize int) error
- func (conn *DBClient) FindAddressTxByHash(chain string, hash common.Hash) (*model.AddressTxs, error)
- func (conn *DBClient) FindAddressTxByIdAndChainAndLimit(chain string, start uint64, limit int) ([]model.AddressTxs, error)
- func (conn *DBClient) FindBalanceByTxHash(hash string) ([]*model.BalanceTxn, error)
- func (conn *DBClient) FindBalanceTxByIdAndChainAndLimit(chain string, balanceIndex uint64, limit int) ([]model.BalanceTxn, error)
- func (conn *DBClient) FindInscriptionByTick(chain, protocol, tick string) (*model.Inscriptions, error)
- func (conn *DBClient) FindInscriptionInfo(chain, protocol, tick, deployHash string) (*model.InscriptionOverView, error)
- func (conn *DBClient) FindInscriptionStatsInfoByBaseId(insId uint32) (*model.InscriptionsStats, error)
- func (conn *DBClient) FindInscriptionsStatsByTick(chain string, protocol string, tick string) (*model.InscriptionsStats, error)
- func (conn *DBClient) FindInscriptionsTxByIdAndChainAndLimit(chain string, nowHour, lastHour time.Time) ([]model.Inscriptions, error)
- func (conn *DBClient) FindLastBlock(chain string) (*model.Block, error)
- func (conn *DBClient) FindLastChainStatHourByChainAndDateHour(chain string, dateHour uint32) (*model.ChainStatHour, error)
- func (conn *DBClient) FindTransaction(chain string, hash common.Hash) (*model.Transaction, error)
- func (conn *DBClient) FindUserBalanceByTick(chain, protocol, tick, addr string) (*model.Balances, error)
- func (conn *DBClient) GetAddressInscriptions(limit, offset int, address, chain, protocol, tick string, key string, sort int) ([]*model.BalanceInscription, int64, error)
- func (conn *DBClient) GetAddressTxs(limit, offset int, address, chain, protocol, tick string, event int8) ([]*model.AddressTransaction, int64, error)
- func (conn *DBClient) GetAllBlocks() ([]model.Block, error)
- func (conn *DBClient) GetAllChainFromBlock() ([]string, error)
- func (conn *DBClient) GetAllChainInfo() ([]model.ChainInfo, error)
- func (conn *DBClient) GetBalancesByIdLimit(chain string, start uint64, limit int) ([]model.Balances, error)
- func (conn *DBClient) GetBalancesChainByAddress(limit, offset int, address, chain, protocol, tick string) ([]*model.BalanceChain, int64, error)
- func (conn *DBClient) GetChainInfoByChain(chain string) (*model.ChainInfo, error)
- func (conn *DBClient) GetHoldersByTick(limit, offset int, chain, protocol, tick string, sortMode int) ([]*model.Balances, int64, error)
- func (conn *DBClient) GetInscriptionStats(chain string, start uint64, limit int) ([]model.InscriptionsStats, error)
- func (conn *DBClient) GetInscriptionStatsByIdLimit(chain string, start uint64, limit int) ([]model.InscriptionsStats, error)
- func (conn *DBClient) GetInscriptionStatsList(limit int, offset int, sort int) ([]model.InscriptionsStats, int64, error)
- func (conn *DBClient) GetInscriptions(limit, offset int, chain, protocol, tick, deployBy string, sort int, ...) ([]*model.InscriptionOverView, int64, error)
- func (conn *DBClient) GetInscriptionsByAddress(limit, offset int, address string) ([]*model.Balances, error)
- func (conn *DBClient) GetInscriptionsByChain(chain string, hashes []string) ([]*model.Inscriptions, error)
- func (conn *DBClient) GetInscriptionsByIdLimit(chain string, start uint64, limit int) ([]model.Inscriptions, error)
- func (conn *DBClient) GetLock() (ok bool, err error)
- func (conn *DBClient) GetTransactions(blockTime, chain string, address string, tick string, limit int, offset int, ...) ([]*model.Transaction, int64, error)
- func (conn *DBClient) GetTransactionsByAddress(limit, offset int, address, chain, protocol, tick, key string, event int8) ([]*model.AddressTransaction, int64, error)
- func (conn *DBClient) GetTxsByHashes(chain string, hashes []common.Hash) ([]*model.Transaction, error)
- func (conn *DBClient) GetUTXOCount(address, chain, protocol, tick string) (int64, error)
- func (conn *DBClient) GetUTXOsByIdLimit(start uint64, limit int) ([]model.UTXO, error)
- func (conn *DBClient) GetUtxosByAddress(address, chain, protocol, tick string) ([]*model.UTXO, error)
- func (conn *DBClient) GroupChainBlockStat(startTime time.Time, end time.Time, startId uint64, chain string) ([]model.ChainBlockStat, error)
- func (conn *DBClient) GroupChainStatHour(limit, offset int, chain []string) ([]model.GroupChainStatHour, error)
- func (conn *DBClient) GroupChainStatHourBy24Hour(startHour, endHour uint32, chain []string) ([]model.GroupChainStatHour, error)
- func (conn *DBClient) MaxIdFromTransaction() (uint64, error)
- func (conn *DBClient) QueryLastBlock(chain string) (*big.Int, error)
- func (conn *DBClient) ReleaseLock() (cnt int64, err error)
- func (conn *DBClient) SaveLastBlock(tx *gorm.DB, status *model.BlockStatus) error
- func (conn *DBClient) UpdateInscriptionsStatsBySID(dbTx *gorm.DB, chain string, id uint32, updates map[string]interface{}) error
Constants ¶
View Source
const ( DatabaseTypeSqlite3 = "sqlite3" DatabaseTypeMysql = "mysql" )
View Source
const ( OrderByModeAsc = 1 OrderByModeDesc = 2 )
View Source
const ( SortTypeId = 0 SortTypeDeployTime = 1 SortTpyeProgress = 2 SortTypeHolders = 3 SortTypeTxCnt = 4 )
View Source
const DBSessionLockKey = "db_session_global_lock_tx"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountResult ¶
type CountResult struct {
Count int64 `gorm:"column:cnt"`
}
type DBClient ¶
func NewDbClient ¶
func NewDbClient(cfg *config.DatabaseConfig) (*DBClient, error)
NewDbClient creates a new database client instance.
func NewMysqlClient ¶
func NewSqliteClient ¶
func (*DBClient) AddChainStatHour ¶
func (conn *DBClient) AddChainStatHour(chainStatHour *model.ChainStatHour) error
func (*DBClient) BatchAddAddressTx ¶
func (*DBClient) BatchAddBalanceTx ¶
func (*DBClient) BatchAddBalances ¶
func (*DBClient) BatchAddInscription ¶
func (*DBClient) BatchAddInscriptionStats ¶
func (*DBClient) BatchAddTransaction ¶
func (*DBClient) BatchUpdateBalances ¶
func (*DBClient) BatchUpdateInscription ¶
func (*DBClient) BatchUpdateInscriptionStats ¶
func (*DBClient) BatchUpdatesBySID ¶
func (*DBClient) CountTickByChain ¶
func (*DBClient) CreateInBatches ¶
func (*DBClient) FindAddressTxByHash ¶
func (*DBClient) FindAddressTxByIdAndChainAndLimit ¶
func (*DBClient) FindBalanceByTxHash ¶
func (conn *DBClient) FindBalanceByTxHash(hash string) ([]*model.BalanceTxn, error)
func (*DBClient) FindBalanceTxByIdAndChainAndLimit ¶
func (*DBClient) FindInscriptionByTick ¶
func (conn *DBClient) FindInscriptionByTick(chain, protocol, tick string) (*model.Inscriptions, error)
FindInscriptionByTick find token by tick
func (*DBClient) FindInscriptionInfo ¶
func (conn *DBClient) FindInscriptionInfo(chain, protocol, tick, deployHash string) (*model.InscriptionOverView, error)
func (*DBClient) FindInscriptionStatsInfoByBaseId ¶
func (conn *DBClient) FindInscriptionStatsInfoByBaseId(insId uint32) (*model.InscriptionsStats, error)
FindInscriptionStatsInfoByBaseId find inscription stats info by base id
func (*DBClient) FindInscriptionsStatsByTick ¶
func (*DBClient) FindInscriptionsTxByIdAndChainAndLimit ¶
func (*DBClient) FindLastBlock ¶
func (*DBClient) FindLastChainStatHourByChainAndDateHour ¶
func (*DBClient) FindTransaction ¶
func (*DBClient) FindUserBalanceByTick ¶
func (*DBClient) GetAddressInscriptions ¶
func (*DBClient) GetAddressTxs ¶
func (*DBClient) GetAllBlocks ¶
GetAllBlocks query all last block from block table
func (*DBClient) GetAllChainFromBlock ¶
GetAllChainFromBlock query all chains from block table
func (*DBClient) GetAllChainInfo ¶
func (*DBClient) GetBalancesByIdLimit ¶
func (*DBClient) GetBalancesChainByAddress ¶
func (*DBClient) GetChainInfoByChain ¶
func (*DBClient) GetHoldersByTick ¶
func (*DBClient) GetInscriptionStats ¶
func (*DBClient) GetInscriptionStatsByIdLimit ¶
func (*DBClient) GetInscriptionStatsList ¶
func (*DBClient) GetInscriptions ¶
func (*DBClient) GetInscriptionsByAddress ¶
func (*DBClient) GetInscriptionsByChain ¶
func (*DBClient) GetInscriptionsByIdLimit ¶
func (*DBClient) GetTransactions ¶
func (conn *DBClient) GetTransactions(blockTime, chain string, address string, tick string, limit int, offset int, sort int) ([]*model.Transaction, int64, error)
GetTransactions find all transaction
func (*DBClient) GetTransactionsByAddress ¶
func (*DBClient) GetTxsByHashes ¶
func (*DBClient) GetUTXOCount ¶
func (*DBClient) GetUTXOsByIdLimit ¶
func (*DBClient) GetUtxosByAddress ¶
func (*DBClient) GroupChainBlockStat ¶
func (*DBClient) GroupChainStatHour ¶
func (*DBClient) GroupChainStatHourBy24Hour ¶
func (*DBClient) MaxIdFromTransaction ¶
func (*DBClient) QueryLastBlock ¶
func (*DBClient) ReleaseLock ¶
func (*DBClient) SaveLastBlock ¶
Click to show internal directories.
Click to hide internal directories.