Documentation ¶
Index ¶
- func AppendIfMissing(slice []*models.Coin, c *models.Coin) []*models.Coin
- func GetCapitalization(volumeStr string, priceStr string) string
- func GetTokenPrice(volumeStr string, reserveStr string, crr uint64) string
- type CreateCoinData
- type Repository
- func (r Repository) DeleteBySymbol(symbol string) error
- func (r *Repository) FindCoinByID(id uint64) (*models.Coin, error)
- func (r *Repository) FindIdBySymbol(symbol string) (uint64, error)
- func (r *Repository) FindSymbolById(id uint64) (string, error)
- func (r *Repository) GetAllCoins() ([]*models.Coin, error)
- func (r Repository) ResetCoinDelegationNotInListIds(idList []uint64) error
- func (r *Repository) Save(c *models.Coin) error
- func (r Repository) SaveAllIfNotExist(coins []*models.Coin) error
- func (r *Repository) SelectCoinsWithBrokenMeta() (*[]models.Coin, error)
- func (r *Repository) UpdateCoinDelegation(id uint64, delegated uint64) error
- func (r *Repository) UpdateCoinMetaInfo(symbol string, trxId, ownerAddrId uint64) error
- type Service
- func (s *Service) CreateNewCoins(coins []*models.Coin) error
- func (s Service) ExtractCoinsFromTransactions(transactions []responses.Transaction) ([]*models.Coin, error)
- func (s *Service) ExtractFromTx(tx responses.Transaction) (*models.Coin, error)
- func (s *Service) GetCoinFromNode(symbol string) (*models.Coin, error)
- func (s *Service) GetUpdateCoinsFromCoinsMapJobChannel() chan map[string]struct{}
- func (s *Service) GetUpdateCoinsFromTxsJobChannel() chan []*models.Transaction
- func (s *Service) SelectCoinsWithBrokenMeta() (*[]models.Coin, error)
- func (s *Service) UpdateCoinMetaInfo(symbol string, trxId, ownerAddrId uint64) error
- func (s *Service) UpdateCoinsInfo(symbols []string) error
- func (s Service) UpdateCoinsInfoFromCoinsMap(job <-chan map[string]struct{})
- func (s *Service) UpdateCoinsInfoFromTxsWorker(jobs <-chan []*models.Transaction)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCapitalization ¶
Types ¶
type CreateCoinData ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *pg.DB) *Repository
func (Repository) DeleteBySymbol ¶
func (r Repository) DeleteBySymbol(symbol string) error
func (*Repository) FindCoinByID ¶
func (r *Repository) FindCoinByID(id uint64) (*models.Coin, error)
Find coin by symbol
func (*Repository) FindIdBySymbol ¶
func (r *Repository) FindIdBySymbol(symbol string) (uint64, error)
Find coin id by symbol
func (*Repository) FindSymbolById ¶
func (r *Repository) FindSymbolById(id uint64) (string, error)
func (*Repository) GetAllCoins ¶
func (r *Repository) GetAllCoins() ([]*models.Coin, error)
func (Repository) ResetCoinDelegationNotInListIds ¶
func (r Repository) ResetCoinDelegationNotInListIds(idList []uint64) error
func (Repository) SaveAllIfNotExist ¶
func (r Repository) SaveAllIfNotExist(coins []*models.Coin) error
func (*Repository) SelectCoinsWithBrokenMeta ¶ added in v0.2.4
func (r *Repository) SelectCoinsWithBrokenMeta() (*[]models.Coin, error)
func (*Repository) UpdateCoinDelegation ¶
func (r *Repository) UpdateCoinDelegation(id uint64, delegated uint64) error
func (*Repository) UpdateCoinMetaInfo ¶ added in v0.2.4
func (r *Repository) UpdateCoinMetaInfo(symbol string, trxId, ownerAddrId uint64) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(env *models.ExtenderEnvironment, nodeApi *noah_node_go_api.NoahNodeApi, repository *Repository, addressRepository *address.Repository, logger *logrus.Entry, dbBadger *badger.DB, ns stan.Conn) *Service
func (Service) ExtractCoinsFromTransactions ¶
func (*Service) ExtractFromTx ¶
func (*Service) GetCoinFromNode ¶
func (*Service) GetUpdateCoinsFromCoinsMapJobChannel ¶
func (*Service) GetUpdateCoinsFromTxsJobChannel ¶
func (s *Service) GetUpdateCoinsFromTxsJobChannel() chan []*models.Transaction
func (*Service) SelectCoinsWithBrokenMeta ¶ added in v0.2.4
func (*Service) UpdateCoinMetaInfo ¶ added in v0.2.4
func (*Service) UpdateCoinsInfo ¶
func (Service) UpdateCoinsInfoFromCoinsMap ¶
func (*Service) UpdateCoinsInfoFromTxsWorker ¶
func (s *Service) UpdateCoinsInfoFromTxsWorker(jobs <-chan []*models.Transaction)
Click to show internal directories.
Click to hide internal directories.