analyzor

package
v0.0.0-...-6986f26 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: BSD-2-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERR_Break error = errors.New("break other nodes")
View Source
var ERR_IgnoreNode error = errors.New("ignored a node")

Functions

func Execute

func Execute(ana *HtmlAnalyzor, actions ...Action) error

源码执行器函数

Types

type Action

type Action interface {
	Do(*html.Node, *HtmlAnalyzor) error
}

type ActionFunc

type ActionFunc func(*html.Node, *HtmlAnalyzor) error

实现Action接口

func (ActionFunc) Do

func (f ActionFunc) Do(node *html.Node, ana *HtmlAnalyzor) error

type AddAlertAction

type AddAlertAction Action

识别篡改的适配器

func AddAlert

func AddAlert() AddAlertAction

type AppendCssAction

type AppendCssAction Action

func AppendCss

func AppendCss(path string) AppendCssAction

type GetResourceAction

type GetResourceAction Action

添加单文件的适配器

func GetResource

func GetResource() GetResourceAction

type HtmlAnalyzor

type HtmlAnalyzor struct {
	*model.HtmlResult
	Filter    IFilter
	AlertList []model.AlertInfo
	Charset   string

	Newwords   [][]byte
	DocSuccess bool
	// contains filtered or unexported fields
}

func (*HtmlAnalyzor) BuildResouces

func (self *HtmlAnalyzor) BuildResouces(parentUrl *url.URL, curUrl string) (key string)

func (*HtmlAnalyzor) Execute

func (self *HtmlAnalyzor) Execute(node *html.Node) (err error)

func (*HtmlAnalyzor) Save

func (self *HtmlAnalyzor) Save() (err error)

type IFilter

type IFilter interface {
	Push([]byte)
	Exists([]byte) bool
	Close() error
	Write() error
	IsEmpty() bool
}

增量过滤器

type MakeVisibleAction

type MakeVisibleAction Action

func MakeVisible

func MakeVisible() MakeVisibleAction

type RemoveBaseLabelAction

type RemoveBaseLabelAction Action

func RemoveBaseLabel

func RemoveBaseLabel() RemoveBaseLabelAction

type RemoveRedirectAction

type RemoveRedirectAction Action

func RemoveRedirect

func RemoveRedirect() RemoveRedirectAction

type RemoveScriptAction

type RemoveScriptAction Action

func RemoveScript

func RemoveScript() RemoveScriptAction

必须在列表中第一个

type SetUTF8Action

type SetUTF8Action Action

func SetUTF8

func SetUTF8() SetUTF8Action

todo 先强转成utf8,否则可能影响效率。

Jump to

Keyboard shortcuts

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