Documentation ¶
Index ¶
- type Repository
- func (r *Repository) FindAll(addresses []string) ([]*models.Address, error)
- func (r *Repository) FindById(id uint) (string, error)
- func (r *Repository) FindId(address string) (uint, error)
- func (r *Repository) FindIdOrCreate(address string) (uint, error)
- func (r *Repository) SaveAllIfNotExist(addresses []string) error
- func (r *Repository) SaveFromMapIfNotExists(addresses map[string]struct{}) error
- type Service
- func (s *Service) ExtractAddressesEventsResponse(response *api_pb.EventsResponse) ([]string, map[string]struct{})
- func (s *Service) ExtractAddressesFromTransactions(transactions []*api_pb.TransactionResponse) ([]string, error, map[string]struct{})
- func (s *Service) GetSaveAddressesJobChannel() chan []string
- func (s *Service) SaveAddressesFromResponses(blockResponse *api_pb.BlockResponse, eventsResponse *api_pb.EventsResponse) error
- func (s *Service) SaveAddressesWorker(jobs <-chan []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *pg.DB) *Repository
func (*Repository) FindAll ¶
func (r *Repository) FindAll(addresses []string) ([]*models.Address, error)
func (*Repository) FindId ¶
func (r *Repository) FindId(address string) (uint, error)
Find address id
func (*Repository) FindIdOrCreate ¶
func (r *Repository) FindIdOrCreate(address string) (uint, error)
Find address id or create if not exist
func (*Repository) SaveAllIfNotExist ¶
func (r *Repository) SaveAllIfNotExist(addresses []string) error
func (*Repository) SaveFromMapIfNotExists ¶
func (r *Repository) SaveFromMapIfNotExists(addresses map[string]struct{}) error
type Service ¶
type Service struct { Storage *Repository // contains filtered or unexported fields }
func NewService ¶
func NewService(env *env.ExtenderEnvironment, repository *Repository, logger *logrus.Entry) *Service
func (*Service) ExtractAddressesEventsResponse ¶
func (s *Service) ExtractAddressesEventsResponse(response *api_pb.EventsResponse) ([]string, map[string]struct{})
func (*Service) ExtractAddressesFromTransactions ¶
func (*Service) GetSaveAddressesJobChannel ¶
func (*Service) SaveAddressesFromResponses ¶ added in v2.12.0
func (s *Service) SaveAddressesFromResponses(blockResponse *api_pb.BlockResponse, eventsResponse *api_pb.EventsResponse) error
SaveAddressesFromResponses Find all addresses in block response and save it
func (*Service) SaveAddressesWorker ¶
Click to show internal directories.
Click to hide internal directories.