Documentation ¶
Index ¶
- type CreateCoinData
- type Repository
- func (r *Repository) Add(c *models.Coin) error
- func (r Repository) DeleteBySymbol(symbol string) error
- func (r *Repository) FindCoinIdBySymbol(symbol string) (uint, error)
- func (r *Repository) FindSymbolById(id uint) (string, error)
- func (r *Repository) GetAllCoins() ([]*models.Coin, error)
- func (r *Repository) GetById(id uint) (*models.Coin, error)
- func (r *Repository) GetCoinBySymbol(symbol string) ([]models.Coin, error)
- func (r *Repository) GetLastCoinId() (uint, error)
- func (r *Repository) RemoveFromCacheBySymbol(symbol string)
- func (r *Repository) Save(c *models.Coin) error
- func (r Repository) SaveAllIfNotExist(coins []*models.Coin) error
- func (r Repository) SaveAllNewIfNotExist(coins []*models.Coin) error
- func (r *Repository) Update(c *models.Coin) error
- func (r *Repository) UpdateAll(coins []*models.Coin) error
- func (r *Repository) UpdateOwnerBySymbol(symbol string, id uint) error
- type Service
- func (s *Service) ChangeOwner(symbol, owner string) error
- func (s *Service) CreateNewCoins(coins []*models.Coin) error
- func (s Service) ExtractCoinsFromTransactions(block *api_pb.BlockResponse) ([]*models.Coin, error)
- func (s *Service) ExtractFromTx(tx *api_pb.BlockResponse_Transaction, blockId uint64) (*models.Coin, error)
- func (s *Service) GetCoinFromNode(coinId uint64, optionalHeight ...uint64) (*models.Coin, error)
- func (s *Service) GetUpdateCoinsFromCoinsMapJobChannel() chan map[uint64]struct{}
- func (s *Service) GetUpdateCoinsFromTxsJobChannel() chan []*models.Transaction
- func (s *Service) RecreateCoin(data *api_pb.RecreateCoinData, height uint64) error
- func (s *Service) UpdateCoinIdCache()
- func (s *Service) UpdateCoinsInfo(coinIds []uint64) error
- func (s Service) UpdateCoinsInfoFromCoinsMap(job <-chan map[uint64]struct{})
- func (s *Service) UpdateCoinsInfoFromTxsWorker(jobs <-chan []*models.Transaction)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateCoinData ¶
type Repository ¶
type Repository struct { DB *pg.DB // 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) FindCoinIdBySymbol ¶
func (r *Repository) FindCoinIdBySymbol(symbol string) (uint, error)
Find coin id by symbol
func (*Repository) FindSymbolById ¶
func (r *Repository) FindSymbolById(id uint) (string, error)
func (*Repository) GetAllCoins ¶
func (r *Repository) GetAllCoins() ([]*models.Coin, error)
func (*Repository) GetCoinBySymbol ¶
func (r *Repository) GetCoinBySymbol(symbol string) ([]models.Coin, error)
func (*Repository) GetLastCoinId ¶
func (r *Repository) GetLastCoinId() (uint, error)
func (*Repository) RemoveFromCacheBySymbol ¶
func (r *Repository) RemoveFromCacheBySymbol(symbol string)
func (Repository) SaveAllIfNotExist ¶
func (r Repository) SaveAllIfNotExist(coins []*models.Coin) error
func (Repository) SaveAllNewIfNotExist ¶
func (r Repository) SaveAllNewIfNotExist(coins []*models.Coin) error
func (*Repository) UpdateOwnerBySymbol ¶
func (r *Repository) UpdateOwnerBySymbol(symbol string, id uint) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(env *env.ExtenderEnvironment, nodeApi *grpc_client.Client, repository *Repository, addressRepository *address.Repository, logger *logrus.Entry) *Service
func (*Service) ChangeOwner ¶
func (Service) ExtractCoinsFromTransactions ¶
func (*Service) ExtractFromTx ¶
func (*Service) GetCoinFromNode ¶
func (*Service) GetUpdateCoinsFromCoinsMapJobChannel ¶
func (*Service) GetUpdateCoinsFromTxsJobChannel ¶
func (s *Service) GetUpdateCoinsFromTxsJobChannel() chan []*models.Transaction
func (*Service) RecreateCoin ¶
func (s *Service) RecreateCoin(data *api_pb.RecreateCoinData, height uint64) error
func (*Service) UpdateCoinIdCache ¶
func (s *Service) UpdateCoinIdCache()
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.