analyzer

package
v0.0.0-...-f53f79a Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: MIT, GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer interface {
	Id() uint32 // 获得ID。
	Analyze(
		respParsers []ParseResponse,
		resp base.Response) ([]base.Data, []error) // 根据规则分析响应并返回请求和条目。
}

分析器的接口类型。

func NewAnalyzer

func NewAnalyzer() Analyzer

创建分析器。

type AnalyzerPool

type AnalyzerPool interface {
	Take() (Analyzer, error)        // 从池中取出一个分析器。
	Return(analyzer Analyzer) error // 把一个分析器归还给池。
	Total() uint32                  // 获得池的总容量。
	Used() uint32                   // 获得正在被使用的分析器的数量。
}

分析器池的接口类型。

func NewAnalyzerPool

func NewAnalyzerPool(
	total uint32,
	gen GenAnalyzer) (AnalyzerPool, error)

type GenAnalyzer

type GenAnalyzer func() Analyzer

生成分析器的函数类型。

type ParseResponse

type ParseResponse func(httpResp *http.Response, respDepth uint32) ([]base.Data, []error)

被用于解析HTTP响应的函数类型。

Jump to

Keyboard shortcuts

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