engine

package
v0.0.0-...-9dec8c7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentEngine

type ConcurrentEngine struct {
	// scheduler 哪里来?肚子里放一个就可以了
	Scheduler   Scheduler
	WorkerCount int
}

func (*ConcurrentEngine) Run

func (e *ConcurrentEngine) Run(seeds ...Request)

自己也最好变成指针类型的接收者

type ParseResult

type ParseResult struct {
	Requests []Request
	Items    []interface{}
}

func NilParser

func NilParser([]byte) ParseResult

type Request

type Request struct {
	Url        string
	ParserFunc func([]byte) ParseResult
}

type Scheduler

type Scheduler interface {
	Submit(Request)
	ConfigureMasterWorkerChan(chan Request)
}

使用者来定义,你去实现

type SimpleEngine

type SimpleEngine struct{}

func (SimpleEngine) Run

func (e SimpleEngine) Run(seeds ...Request)

可以送很多种子

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL