Exporter and Extractor interfaces moved to its own package for simplicity of main Geziyor package
This commit is contained in:
13
geziyor.go
13
geziyor.go
@ -1,7 +1,6 @@
|
||||
package geziyor
|
||||
|
||||
import (
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"github.com/fpfeng/httpcache"
|
||||
"github.com/geziyor/geziyor/client"
|
||||
"github.com/geziyor/geziyor/metrics"
|
||||
@ -11,18 +10,6 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// Extractor interface is for extracting data from HTML document
|
||||
type Extractor interface {
|
||||
Extract(doc *goquery.Document) (interface{}, error)
|
||||
}
|
||||
|
||||
// Exporter interface is for extracting data to external resources.
|
||||
// Geziyor calls every extractors Export functions before any scraping starts.
|
||||
// Export functions should wait for new data from exports chan.
|
||||
type Exporter interface {
|
||||
Export(exports chan interface{})
|
||||
}
|
||||
|
||||
// Geziyor is our main scraper type
|
||||
type Geziyor struct {
|
||||
Opt *Options
|
||||
|
Reference in New Issue
Block a user