Documentation ¶
Index ¶
- Variables
- func GetFields(taskName, ruleName string) []string
- type Crawler
- type CrawlerStore
- type Option
- func WithFetcher(fetcher spider.Fetcher) Option
- func WithLogger(logger *zap.Logger) Option
- func WithRegistryURL(registryURL string) Option
- func WithScheduler(scheduler Scheduler) Option
- func WithSeeds(seeds []*spider.Task) Option
- func WithStorage(s spider.Storage) Option
- func WithWorkCount(workCount int) Option
- type Schedule
- type Scheduler
Constants ¶
This section is empty.
Variables ¶
View Source
var Store = &CrawlerStore{ list: make([]*spider.Task, 0), Hash: make(map[string]*spider.Task), }
Store 全局爬虫(蜘蛛)任务实例
Functions ¶
Types ¶
type Crawler ¶
type Crawler struct { Visited map[string]bool VisitedLock sync.Mutex // contains filtered or unexported fields }
func (*Crawler) CreateWork ¶
func (e *Crawler) CreateWork()
func (*Crawler) HandleResult ¶
func (e *Crawler) HandleResult()
func (*Crawler) SetFailure ¶
func (*Crawler) StoreVisited ¶
type CrawlerStore ¶
func (*CrawlerStore) Add ¶
func (c *CrawlerStore) Add(task *spider.Task)
func (*CrawlerStore) AddJSTask ¶
func (c *CrawlerStore) AddJSTask(m *spider.TaskModel)
type Option ¶
type Option func(opts *options)
func WithFetcher ¶
func WithLogger ¶
func WithRegistryURL ¶
func WithScheduler ¶
func WithStorage ¶
func WithWorkCount ¶
type Schedule ¶
func NewSchedule ¶
func NewSchedule() *Schedule
Click to show internal directories.
Click to hide internal directories.