engine

package
v1.0.7-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartRequest = "StartRequest should not be given a stream that is not a request"
)

Variables

View Source
var (
	RegisterNilErr = errors.New("registered spiders should not be nil")

	SendUnknownComponentErr = errors.New("the component that needs to be pushed is not recognized")
)

engine err

Functions

func ShortEngine

func ShortEngine(opts ...optionFunc) *shortEngine

func WithCheckTime

func WithCheckTime(t time.Duration) optionFunc

func WithDownload

func WithDownload(down download.Download) optionFunc

func WithOutputter

func WithOutputter(out outputter.Outputter) optionFunc

func WithScheduler

func WithScheduler(scd scheduler.Scheduler) optionFunc

func WithTreadCount

func WithTreadCount(num int) optionFunc

Types

type Engine

type Engine interface {
	Start(ctx context.Context)
	Close()

	Register(sp spider.Spider) error
}

Jump to

Keyboard shortcuts

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