Documentation ¶
Index ¶
- type CollectEvent
- type Crawler
- type DefaultHtmlCrawler
- type Event
- func (event *Event) ApiSpider(size int) spider.Spider
- func (event *Event) ConvertAssign(src, des interface{}) error
- func (event *Event) DhtmlSpider() spider.Spider
- func (event *Event) FileSpider(size int) spider.Spider
- func (event *Event) GenerateRandomID() string
- func (event *Event) NewMutex() *sync.Mutex
- func (event *Event) Parser(content, pattern string) (interface{}, error)
- func (event *Event) ReadabilityParser(html, url string) (map[string]interface{}, error)
- func (event *Event) ShtmlSpider(size int) spider.Spider
- func (event *Event) Signature(obj interface{}) string
- func (event *Event) SignatureMap(data map[string]string) string
- type ParserEvent
- type PipeLine
- type Report
- type ReportType
- type StorageEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crawler ¶
type Crawler interface { Collect(event CollectEvent) (string, error) Parser(event ParserEvent) (map[string]interface{}, error) Storage(event StorageEvent) error }
type DefaultHtmlCrawler ¶
type DefaultHtmlCrawler struct { }
func (*DefaultHtmlCrawler) Collect ¶
func (dhc *DefaultHtmlCrawler) Collect(event CollectEvent) (string, error)
func (*DefaultHtmlCrawler) Parser ¶
func (dhc *DefaultHtmlCrawler) Parser(event ParserEvent) (map[string]interface{}, error)
func (*DefaultHtmlCrawler) Storage ¶
func (dhc *DefaultHtmlCrawler) Storage(event StorageEvent) error
type Event ¶
type Event struct {
TempStorage *temp.TempStorage
}
func (*Event) ConvertAssign ¶
func (*Event) DhtmlSpider ¶
func (*Event) GenerateRandomID ¶
func (*Event) ReadabilityParser ¶
type PipeLine ¶
type PipeLine struct {
// contains filtered or unexported fields
}
func (*PipeLine) AddCrawler ¶
func (p *PipeLine) AddCrawler(crawlerName task.CrawlerName, crawler Crawler)
添加抓取模版
type ReportType ¶
type ReportType int
const ( CrawlerBeforeReport ReportType = iota + 1 CrawlerAfterReport ParserBeforeReport ParserAfterReport StorageBeforeReport StorageAfterReport )
func (ReportType) String ¶
func (r ReportType) String() string
Click to show internal directories.
Click to hide internal directories.