Documentation
¶
Index ¶
- type Crawler
- type CrawlerSupervisor
- func (cs *CrawlerSupervisor) AddJobToBuffer(path string)
- func (cs *CrawlerSupervisor) BuffSize() int
- func (cs *CrawlerSupervisor) CompleteJob(j Job)
- func (cs *CrawlerSupervisor) CrawlJobs()
- func (cs *CrawlerSupervisor) GetVisitedLinks() []string
- func (cs *CrawlerSupervisor) HasPending() bool
- func (cs *CrawlerSupervisor) Start(done chan bool)
- type Job
- type Result
- type Sitemap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crawler ¶
func NewCrawler ¶
NewCrawler creates a crawler for the given domain
type CrawlerSupervisor ¶
type CrawlerSupervisor struct {
// contains filtered or unexported fields
}
CrawlerSupervisor control the execution of the crawler
func NewCrawlerSupervisor ¶
func NewCrawlerSupervisor(c *Crawler) *CrawlerSupervisor
NewCrawlerSupervisor returns a new CrawlerSupervisor
func (*CrawlerSupervisor) AddJobToBuffer ¶
func (cs *CrawlerSupervisor) AddJobToBuffer(path string)
AddJobToBuffer creates a new job for the given path and adds it to the buffer
func (*CrawlerSupervisor) BuffSize ¶
func (cs *CrawlerSupervisor) BuffSize() int
BuffSize returns the len of the buffer
func (*CrawlerSupervisor) CompleteJob ¶
func (cs *CrawlerSupervisor) CompleteJob(j Job)
CompleteJob Removes the job from pending list
func (*CrawlerSupervisor) CrawlJobs ¶
func (cs *CrawlerSupervisor) CrawlJobs()
CrawlJobs crawls all jobs in the buffer concurrently
func (*CrawlerSupervisor) GetVisitedLinks ¶
func (cs *CrawlerSupervisor) GetVisitedLinks() []string
GetVisitedLinks returns a set of all visited links
func (*CrawlerSupervisor) HasPending ¶
func (cs *CrawlerSupervisor) HasPending() bool
HasPending returns true if there are jobs in the pending list
func (*CrawlerSupervisor) Start ¶
func (cs *CrawlerSupervisor) Start(done chan bool)
Start crawls buffered jobs until pending list is empty
Click to show internal directories.
Click to hide internal directories.