handler

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DataTypes = echo.NewKVData().Add("int", "整数").Add("float", "小数").Add("bool", "布尔值").Add("string", "字符串").
	Add("int-array", "整数数组").Add("float-array", "小数数组").Add("bool-array", "布尔值数组").Add("string-array", "字符串数组").
	Add("map", "字典").Add("array", "数组").
	Add("json", "JSON数据作为结果值").Add("jsonparse", "从JSON数据中解析").
	Add("href", "href属性值").Add("src", "src属性值").Add("alt", "alt属性值").
	Add("text-array", "纯文本数组").Add("href-array", "href属性值数组").
	Add("html-array", "HTML内容数组").Add("html", "innerHTML内容").Add("outhtml", "父级HTML").
	Add("raw", "直接用规则作为结果值")
View Source
var GoProcs = sync.Map{}
View Source
var LeftNavigate = &navigate.Item{
	Display: true,
	Name:    `数据采集`,
	Action:  `collector`,
	Icon:    `truck`,
	Children: &navigate.List{
		{
			Display: true,
			Name:    `规则管理`,
			Action:  `rule`,
		},
		{
			Display: true,
			Name:    `新建规则`,
			Action:  `rule_add`,
			Icon:    `plus`,
		},
		{
			Display: true,
			Name:    `历史记录`,
			Action:  `history`,
		},
		{
			Display: false,
			Name:    `查看历史内容`,
			Action:  `history_view`,
		},
		{
			Display: false,
			Name:    `删除历史记录`,
			Action:  `history_delete`,
		},
		{
			Display: true,
			Name:    `数据导出`,
			Action:  `export`,
		},
		{
			Display: false,
			Name:    `添加导出规则`,
			Action:  `export_add`,
		},
		{
			Display: false,
			Name:    `修改导出规则`,
			Action:  `export_edit`,
		},
		{
			Display: false,
			Name:    `删除导出规则`,
			Action:  `export_delete`,
		},
		{
			Display: false,
			Name:    `导出日志管理`,
			Action:  `export_log`,
		},
		{
			Display: false,
			Name:    `查看导出日志`,
			Action:  `export_log_view/:id`,
		},
		{
			Display: false,
			Name:    `删除导出日志`,
			Action:  `export_log_delete`,
		},
		{
			Display: false,
			Name:    `更改导出日志状态`,
			Action:  `export_edit_status`,
		},
		{
			Display: true,
			Name:    `分组管理`,
			Action:  `group`,
		},
		{
			Display: true,
			Name:    `添加分组`,
			Action:  `group_add`,
			Icon:    `plus`,
		},
		{
			Display: false,
			Name:    `修改规则`,
			Action:  `rule_edit`,
			Icon:    ``,
		},
		{
			Display: false,
			Name:    `删除规则`,
			Action:  `rule_delete`,
			Icon:    ``,
		},
		{
			Display: false,
			Name:    `规则测试`,
			Action:  `rule_collect`,
			Icon:    ``,
		},
		{
			Display: false,
			Name:    `修改分组`,
			Action:  `group_edit`,
			Icon:    ``,
		},
		{
			Display: false,
			Name:    `删除分组`,
			Action:  `group_delete`,
			Icon:    ``,
		},
		{
			Display: false,
			Name:    `测试正则表达式`,
			Action:  `regexp_test`,
			Icon:    ``,
		},
	},
}

Functions

func CollectPageJob

func CollectPageJob(id string) cron.Runner

CollectPageJob 计划任务调用方式

func Exit

func Exit(k interface{}) (bool, error)

func Export

func Export(c echo.Context) error

func ExportAdd

func ExportAdd(ctx echo.Context) error

func ExportDelete

func ExportDelete(ctx echo.Context) error

func ExportEdit

func ExportEdit(ctx echo.Context) error

func ExportEditStatus

func ExportEditStatus(ctx echo.Context) error

func ExportLog

func ExportLog(ctx echo.Context) error

func ExportLogDelete

func ExportLogDelete(ctx echo.Context) error

func ExportLogView

func ExportLogView(ctx echo.Context) error

func Go

func Go(k interface{}, r *exec.Rules, f func(), ctx context.Context) (err error)

func Group

func Group(ctx echo.Context) error

func GroupAdd

func GroupAdd(ctx echo.Context) error

func GroupDelete

func GroupDelete(ctx echo.Context) error

func GroupEdit

func GroupEdit(ctx echo.Context) error

func History

func History(c echo.Context) error

func HistoryDelete

func HistoryDelete(c echo.Context) error

func HistoryView

func HistoryView(c echo.Context) error

func RegexpTest

func RegexpTest(c echo.Context) error

func RegisterRoute

func RegisterRoute(r *route.Collection)

func Rule

func Rule(c echo.Context) error

func RuleAdd

func RuleAdd(c echo.Context) error

func RuleCollect

func RuleCollect(c echo.Context) error

func RuleDelete

func RuleDelete(c echo.Context) error

func RuleEdit

func RuleEdit(c echo.Context) error

Types

type GoProcess

type GoProcess struct {
	Rules *exec.Rules
	Done  bool
}

func NewProc

func NewProc(r *exec.Rules) *GoProcess

func (*GoProcess) Close

func (g *GoProcess) Close(k interface{})

func (*GoProcess) IsExited

func (g *GoProcess) IsExited() bool

type RegexpForm

type RegexpForm struct {
	Src    string
	Regexp string
	Type   string
	Error  string
	Result interface{}
}

Jump to

Keyboard shortcuts

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