Documentation ¶
Index ¶
- Constants
- Variables
- func NewAttributeExtractor(selector string, attributeName string) *attributeExtractor
- func NewFollower(name string, selector string, de DataExtractors) *follower
- func NewTextExtractor(selector string) *textExtractor
- type AppLogger
- type ConfigDecodeError
- type ConfigFieldError
- type DataExtractor
- type DataExtractors
- type Exporter
- type Extractor
- type Extractors
- type Fetcher
- type Follower
- type Followers
- type HTTPFetcher
- type Item
- type ItemExtractor
- type Items
- type Response
- type Runner
- type RunnerOptions
- type Scraper
- type ScrapersConfig
Constants ¶
View Source
const ( LogLevelFatal = iota LogLevelError LogLevelInfo LogLevelDebug )
Variables ¶
View Source
var DefaultRunnerOptions = &RunnerOptions{ ExportersSize: 1, LogLevel: LogLevelFatal, }
Functions ¶
func NewAttributeExtractor ¶
func NewFollower ¶
func NewFollower(name string, selector string, de DataExtractors) *follower
func NewTextExtractor ¶
func NewTextExtractor(selector string) *textExtractor
Types ¶
type ConfigDecodeError ¶
type ConfigDecodeError struct {
// contains filtered or unexported fields
}
func (*ConfigDecodeError) Error ¶
func (e *ConfigDecodeError) Error() string
type ConfigFieldError ¶
type ConfigFieldError struct {
// contains filtered or unexported fields
}
func (*ConfigFieldError) Error ¶
func (e *ConfigFieldError) Error() string
type DataExtractor ¶
type DataExtractors ¶
type DataExtractors map[string]DataExtractor
type Exporter ¶
type Exporter interface {
Export(Item)
}
func NewStdoutExporter ¶
func NewStdoutExporter() Exporter
type Extractors ¶
type Fetcher ¶
func NewFetcher ¶
type HTTPFetcher ¶
type HTTPFetcher struct {
// contains filtered or unexported fields
}
func NewHTTPFetcher ¶
func NewHTTPFetcher(u *url.URL) *HTTPFetcher
func (*HTTPFetcher) Fetch ¶
func (f *HTTPFetcher) Fetch(log AppLogger) Response
func (*HTTPFetcher) URL ¶
func (f *HTTPFetcher) URL() *url.URL
type ItemExtractor ¶
type ItemExtractor struct { Selector string DataExtractors DataExtractors // contains filtered or unexported fields }
func NewItemExtractor ¶
func NewItemExtractor(name string, de DataExtractors) *ItemExtractor
func (*ItemExtractor) Name ¶
func (e *ItemExtractor) Name() string
type Response ¶
type Response interface { ReadCloser() io.ReadCloser Error() error }
type RunnerOptions ¶
type Scraper ¶
type Scraper struct { Name string Fetcher Fetcher Exporter Exporter Extractors Extractors Followers Followers }
type ScrapersConfig ¶
type ScrapersConfig map[string]scraperConfig
func NewConfigFromFile ¶
func NewConfigFromFile(p string) (ScrapersConfig, error)
func NewConfigFromReader ¶
func NewConfigFromReader(r io.Reader) (ScrapersConfig, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.