Implement ForeignScrapperer interface at pkg/dia/scraper/foreign-scrapers/Scrapper.go file
ForeignScrapperer
pkg/dia/scraper/foreign-scrapers/Scrapper.go
type ForeignScrapperer interface { UpdateQuotation() error GetQuoteChannel() chan *models.ForeignQuotation }
Add the scraper implementation a MyForeignScraper.go Golang file to pkg/dia/scraper/foreign-scrapers/ folder and add the next implementations:
MyForeignScraper.go
pkg/dia/scraper/foreign-scrapers/
func (scraper *MyForeignScraper) Pool() chan dia.Pool {} func (scraper *MyForeignScraper) Done() chan bool {}
func NewMyForeignScraper(exchange dia.Exchange) *MyForeignScraper {}
MyForeignScraper
cmd/foreignscraper/foreign.go
switch *scraperType { case "MyForeignScraper": log.Println("Start scraping data") sc = scrapers.NewMyForeignScraper(ds) }
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && foreignscraper -foreignType=ForeignType
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && foreignscraper -foreignType=FOREIGN_TYPE
There was an error while loading. Please reload this page.