core

package
v0.0.0-...-b81122d Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Default_WorkNum = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func GetEngine

func GetEngine() *Engine

func New

func New() *Engine

func (*Engine) AddSpider

func (m *Engine) AddSpider(spider *spider.Spider) *Engine

func (*Engine) EndTask

func (m *Engine) EndTask(name string) error

func (*Engine) GetTaskMetas

func (m *Engine) GetTaskMetas() map[string]*TaskMeta

func (*Engine) ListTask

func (m *Engine) ListTask() []*spider.Spider

func (*Engine) Run

func (m *Engine) Run()

func (*Engine) RunTask

func (m *Engine) RunTask(name string) error

func (*Engine) StopTask

func (m *Engine) StopTask(name string) error

type SpiderRuntime

type SpiderRuntime struct {
	sync.Mutex

	TaskMeta *TaskMeta
	// contains filtered or unexported fields
}

func NewSpiderRuntime

func NewSpiderRuntime() *SpiderRuntime

func (*SpiderRuntime) Exit

func (s *SpiderRuntime) Exit()

func (*SpiderRuntime) GetSpider

func (s *SpiderRuntime) GetSpider() *spider.Spider

func (*SpiderRuntime) Run

func (s *SpiderRuntime) Run()

func (*SpiderRuntime) SetSpider

func (s *SpiderRuntime) SetSpider(spider *spider.Spider)

func (*SpiderRuntime) Stop

func (s *SpiderRuntime) Stop()

type TaskMeta

type TaskMeta struct {
	DownloadFailCount int32 `json:"download_fail_count"`
	DownloadCount     int32 `json:"download_fail_count"`
	URLNum            int32 `json:"url_num"`
	WaitURLNum        int   `json:"wait_url_num"`
	CrawlerResultNum  int32 `json:"crawler_result_num"`
}

Jump to

Keyboard shortcuts

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