1 Star 1 Fork 1

xiaoyutab / xgotool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
init.go 636 Bytes
一键复制 编辑 原始数据 按行查看 历史
xiaoyutab 提交于 2024-04-30 10:16 . 调整目录结构和依赖位置
// 自定义中间件处理依赖
package xmid
import (
"math"
)
// 定义abort停止处理的最大值,用于判断到达此值以后将不再往下执行
const abortConst int = math.MaxInt >> 1
// 中间件需要传入的函数体
type HandlerFunc func(*Context)
// 获取一个空的中间事务支持
func DefaultEmpty() *Context {
return &Context{}
}
// 获取默认中间件事务支持
// 此事务已存在回滚事务和提交事务
func Default() *Context {
return &Context{
hookCommit: []HandlerFunc{hook_commit}, // 默认提交钩子
hookRollback: []HandlerFunc{hook_rollback}, // 默认回滚钩子
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/xiaoyutab/xgotool.git
git@gitee.com:xiaoyutab/xgotool.git
xiaoyutab
xgotool
xgotool
v0.3.13

搜索帮助

344bd9b3 5694891 D2dac590 5694891