address

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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) FindById

func (r *Repository) FindById(id uint64) (string, error)

func (*Repository) FindId

func (r *Repository) FindId(address string) (uint64, error)

Find address id

func (*Repository) FindIdOrCreate

func (r *Repository) FindIdOrCreate(address string) (uint64, 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 {
	// contains filtered or unexported fields
}

func NewService

func NewService(env *models.ExtenderEnvironment, repository *Repository, chBalanceAddresses chan<- models.BlockAddresses, logger *logrus.Entry) *Service

func (*Service) ExtractAddressesEventsResponse

func (s *Service) ExtractAddressesEventsResponse(response *responses.EventsResponse) ([]string, map[string]struct{})

func (*Service) ExtractAddressesFromTransactions

func (s *Service) ExtractAddressesFromTransactions(transactions []responses.Transaction) ([]string, error, map[string]struct{})

func (*Service) FindId

func (s *Service) FindId(address string) (uint64, error)

func (*Service) GetSaveAddressesJobChannel

func (s *Service) GetSaveAddressesJobChannel() chan []string

func (*Service) HandleResponses

func (s *Service) HandleResponses(blockResponse *responses.BlockResponse, eventsResponse *responses.EventsResponse) error

Find all addresses in block response and save it

func (*Service) SaveAddressesWorker

func (s *Service) SaveAddressesWorker(jobs <-chan []string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL