hotgo/server/internal/service/hook.go

32 lines
641 B
Go
Raw Normal View History

2022-12-11 20:48:18 +08:00
// ================================================================================
2022-11-24 23:37:34 +08:00
// Code generated by GoFrame CLI tool. DO NOT EDIT.
2022-12-11 20:48:18 +08:00
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================
2022-11-24 23:37:34 +08:00
package service
import (
"github.com/gogf/gf/v2/net/ghttp"
)
2022-12-11 20:48:18 +08:00
type (
IHook interface {
AfterOutput(r *ghttp.Request)
2022-12-11 20:48:18 +08:00
}
)
2022-11-24 23:37:34 +08:00
2022-12-11 20:48:18 +08:00
var (
localHook IHook
)
2022-11-24 23:37:34 +08:00
func Hook() IHook {
if localHook == nil {
panic("implement not found for interface IHook, forgot register?")
}
return localHook
}
func RegisterHook(i IHook) {
localHook = i
}