1 Star 0 Fork 0

liangchao/gweb

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
events.go 525 Bytes
一键复制 编辑 原始数据 按行查看 历史
LiangChao(GW00244384) 提交于 2025-07-23 15:29 +08:00 . 2.0
package gweb
func (app *GinApp) BeforeRun(f EventHandler) {
handlers := app.events["BeforeRun"]
if handlers == nil {
app.events["BeforeRun"] = []EventHandler{}
}
handlers = app.events["BeforeRun"]
handlers = append(handlers, f)
app.events["BeforeRun"] = handlers
}
func (app *GinApp) OnError(f EventHandler) {
handlers := app.events["OnError"]
if handlers == nil {
app.events["OnError"] = []EventHandler{}
}
handlers = app.events["OnError"]
handlers = append(handlers, f)
app.events["OnError"] = handlers
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/makitdone/gweb.git
git@gitee.com:makitdone/gweb.git
makitdone
gweb
gweb
v2.0.1

搜索帮助