Documentation ¶
Index ¶
- Constants
- type MemCache
- func (m *MemCache) GetAccountIndexByName(accountName string) (int64, error)
- func (m *MemCache) GetAccountIndexByPk(accountPk string) (int64, error)
- func (m *MemCache) GetAccountNameByIndex(accountIndex int64) (string, error)
- func (m *MemCache) GetAccountPkByIndex(accountIndex int64) (string, error)
- func (m *MemCache) GetAccountTotalCountWiltFallback(f fallback) (int64, error)
- func (m *MemCache) GetAccountWithFallback(accountIndex int64, f fallback) (*accdao.Account, error)
- func (m *MemCache) GetAssetByIdWithFallback(assetId int64, f fallback) (*assetdao.Asset, error)
- func (m *MemCache) GetAssetBySymbolWithFallback(assetSymbol string, f fallback) (*assetdao.Asset, error)
- func (m *MemCache) GetAssetNameById(assetId int64) (string, error)
- func (m *MemCache) GetAssetSymbolById(assetId int64) (string, error)
- func (m *MemCache) GetAssetTotalCountWithFallback(f fallback) (int64, error)
- func (m *MemCache) GetBlockByCommitmentWithFallback(blockCommitment string, f fallback) (*blockdao.Block, error)
- func (m *MemCache) GetBlockByHeightWithFallback(blockHeight int64, f fallback) (*blockdao.Block, error)
- func (m *MemCache) GetBlockTotalCountWithFallback(f fallback) (int64, error)
- func (m *MemCache) GetPriceWithFallback(symbol string, f fallback) (float64, error)
- func (m *MemCache) GetSysConfigWithFallback(configName string, f fallback) (*sysconfig.SysConfig, error)
- func (m *MemCache) GetTxByHashWithFallback(txHash string, f fallback) (*tx.Tx, error)
- func (m *MemCache) GetTxTotalCountWithFallback(f fallback) (int64, error)
- func (m *MemCache) SetPrice(symbol string, price float64)
Constants ¶
View Source
const ( AccountIndexNameKeyPrefix = "in:" //key for cache: accountIndex -> accountName AccountIndexPkKeyPrefix = "ip:" //key for cache: accountIndex -> accountPk AccountNameKeyPrefix = "n:" //key for cache: accountName -> accountIndex AccountPkKeyPrefix = "k:" //key for cache: accountPk -> accountIndex AccountByIndexKeyPrefix = "a:" //key for cache: accountIndex -> account AccountCountKeyPrefix = "ac" //key for cache: total account count BlockByHeightKeyPrefix = "h:" //key for cache: blockHeight -> block BlockByCommitmentKeyPrefix = "c:" //key for cache: blockCommitment -> block BlockCountKeyPrefix = "bc" //key for cache: total block count TxByHashKeyPrefix = "h:" //key for cache: txHash -> tx TxCountKeyPrefix = "tc" //key for cache: total tx count AssetCountKeyKeyPrefix = "AC" //key for cache: total asset count AssetIdNameKeyPrefix = "IN:" //key for cache: assetId -> assetName AssetIdSymbolKeyPrefix = "IS:" //key for cache: assetId -> assetName AssetByIdKeyPrefix = "I:" //key for cache: assetId -> asset AssetBySymbolKeyPrefix = "S:" //key for cache: assetSymbol -> asset PriceKeyPrefix = "p:" //key for cache: symbol -> price SysConfigKeyPrefix = "s:" //key for cache: configName -> sysconfig )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemCache ¶
type MemCache struct {
// contains filtered or unexported fields
}
func MustNewMemCache ¶ added in v0.0.4
func MustNewMemCache(accountModel accdao.AccountModel, assetModel assetdao.AssetModel, accountExpiration, blockExpiration, txExpiration, assetExpiration, priceExpiration int, maxCounterNum, maxKeyNum int64) *MemCache
func (*MemCache) GetAccountIndexByName ¶
func (*MemCache) GetAccountIndexByPk ¶
func (*MemCache) GetAccountNameByIndex ¶
func (*MemCache) GetAccountPkByIndex ¶
func (*MemCache) GetAccountTotalCountWiltFallback ¶
func (*MemCache) GetAccountWithFallback ¶
func (*MemCache) GetAssetByIdWithFallback ¶
func (*MemCache) GetAssetBySymbolWithFallback ¶
func (*MemCache) GetAssetNameById ¶
func (*MemCache) GetAssetSymbolById ¶
func (*MemCache) GetAssetTotalCountWithFallback ¶
func (*MemCache) GetBlockByCommitmentWithFallback ¶
func (*MemCache) GetBlockByHeightWithFallback ¶
func (*MemCache) GetBlockTotalCountWithFallback ¶
func (*MemCache) GetPriceWithFallback ¶
func (*MemCache) GetSysConfigWithFallback ¶
func (*MemCache) GetTxByHashWithFallback ¶
func (*MemCache) GetTxTotalCountWithFallback ¶
Click to show internal directories.
Click to hide internal directories.