-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbizctx.go
35 lines (28 loc) · 786 Bytes
/
bizctx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// ================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================
package service
import (
"context"
"github.com/gogf/gf/v2/net/ghttp"
)
type (
IBizCtx interface {
Init(r *ghttp.Request)
SetValue(ctx context.Context, key string, value any)
GetValue(ctx context.Context, key string) any
}
)
var (
localBizCtx IBizCtx
)
func BizCtx() IBizCtx {
if localBizCtx == nil {
panic("implement not found for interface IBizCtx, forgot register?")
}
return localBizCtx
}
func RegisterBizCtx(i IBizCtx) {
localBizCtx = i
}