This commit is contained in:
withchao
2023-01-12 10:07:08 +08:00
parent d142988390
commit 2841109f31
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -20,6 +20,11 @@ func NewCtx(c *gin.Context, api string) context.Context {
return context.WithValue(c, TraceLogKey, req)
}
func NewCtx1(c *gin.Context, api, operationID string) context.Context {
req := &ApiInfo{ApiName: api, GinCtx: c, OperationID: operationID, Funcs: &[]FuncInfo{}}
return context.WithValue(c, TraceLogKey, req)
}
func NewRpcCtx(c context.Context, rpc string, operationID string) context.Context {
req := &ApiInfo{ApiName: rpc, Funcs: &[]FuncInfo{}}
ctx := context.WithValue(c, TraceLogKey, req)