Ai
0 Star 1 Fork 0

shallot/Go开发工具集

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
callback_database.go 963 Bytes
一键复制 编辑 原始数据 按行查看 历史
shallot 提交于 2024-08-22 14:58 +08:00 . 移入autohttp库。
package autohttp
import "context"
// 数据库操作类回调函数
type DatabaseCallbackInterface interface {
// 创建初始任务
CreateTask(c context.Context, item *Item) (err error)
// 删除任务
DeleteTask(c context.Context, taskId uint64) (err error)
// 查询待重试的任务(仅ID)
IncompleteTaskIdList(c context.Context, currentTime int64) (list []uint64, err error)
// 待清理任务列表,status表示状态,timestamp表示某个Unix时间点之前
TaskToCleanList(c context.Context, status uint8, timestamp int64) (list []uint64, err error)
// 查询任务详细信息
TaskDetail(c context.Context, taskId uint64) (item Item, err error)
// 查询任务详细信息
TaskDetailByBusiness(c context.Context, businessType string, businessId string) (item Item, err error)
// 更新任务
UpdateTask(c context.Context, item *Item) (err error)
}
// 全局数据库回调方法
var DatabaseCallback DatabaseCallbackInterface = nil
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/gxsshallot/gotool.git
git@gitee.com:gxsshallot/gotool.git
gxsshallot
gotool
Go开发工具集
d05a69787598

搜索帮助