Documentation
¶
Index ¶
Constants ¶
View Source
const ( StateCrawling = SpiderState(0) StateStopped = SpiderState(1) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CrawledSite ¶
CrawledSite respresents a crawled site.
type CrawledSiteHandler ¶
type CrawledSiteHandler func(site CrawledSite, spider *Spider)
CrawledSiteHandler is a closure type that defines a function that is called upon a spider crawling a site.
type ShouldCrawlURLHandler ¶
ShouldCrawlURLHandler is a closure type that defines a function that is called upon to check whether or not the spider should crawl a url.
type Spider ¶
type Spider struct { OnCrawl CrawledSiteHandler Logger *log.Logger WorkerCount uint SendDelay *time.Duration CrawlDelay *time.Duration ShouldCrawl ShouldCrawlURLHandler // contains filtered or unexported fields }
Spider defines an instance of a web crawler.
func New ¶
New creates a new spider workerCount defines how many workers for both crawling and handling crawled sites.
func (*Spider) SendSitesMap ¶
SendSitesMap allows you to externally send urls to the spider for handling
Click to show internal directories.
Click to hide internal directories.