1 Star 1 Fork 0

tym_hmm/timer-task

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Api.go 1005 Bytes
一键复制 编辑 原始数据 按行查看 历史
天蝎儿 提交于 2024-06-04 15:09 +08:00 . 增加任务更新
package TimerTask
/*
*
主任务执行接口
*/
type CrawlerApi interface {
/**
设置运行方式
@param crawlerType CRAWLER_TYPE 运行方式: kelleyCrawler.CONF_CRAWLER_TYPE_BACKGROUND(后台运行) | kelleyCrawler.CONF_CRAWLER_TYPE_FRONT(前台运行阻塞,默认)
*/
SetCrawlerType(taskType TASK_TYPE) *task
//添加一个任务
AddJob(node *InfoNode) *TaskError
RemoveJob(node *InfoNode)
UpdateJob(node *InfoNode)
//启动事件
StartHandle(handle func(tc CrawlerApi)) CrawlerApi
/**
任务执行
*/
Run()
}
/*
*
单个爬取规则
所有规则需集成此接口
*/
type CrawlerItemRules interface {
/**
返回页面
@param currentPageUrl string 当前执行的地址
@param stage int 当前执行的阶段
@param content string 获取的内容
@return bool true 执行下一个 false 不执行
*/
SuccessHandle(context *Context, stage int32, content string) bool
//错误提示
ErrorHandle(currentPageUrl string, stage int32, tryTime int32, code int, err error)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tym_hmm/timer-task.git
git@gitee.com:tym_hmm/timer-task.git
tym_hmm
timer-task
timer-task
v1.1.8

搜索帮助