支持custom context #10
| @ -11,6 +11,8 @@ import ( | |||||||
| 	"strings" | 	"strings" | ||||||
| 	"sync" | 	"sync" | ||||||
|  |  | ||||||
|  | 	"git.zhangdeman.cn/zhangdeman/trace" | ||||||
|  |  | ||||||
| 	"git.zhangdeman.cn/zhangdeman/gin/define" | 	"git.zhangdeman.cn/zhangdeman/gin/define" | ||||||
| 	"git.zhangdeman.cn/zhangdeman/gin/request/parse_body" | 	"git.zhangdeman.cn/zhangdeman/gin/request/parse_body" | ||||||
| 	"git.zhangdeman.cn/zhangdeman/wrapper" | 	"git.zhangdeman.cn/zhangdeman/wrapper" | ||||||
| @ -298,3 +300,8 @@ func (wh *wrapperHandle) GetLogicAfterResponse(ctx *gin.Context) *define.LogicAf | |||||||
| func (wh *wrapperHandle) GetCustomContext(ctx *gin.Context) *define.Context { | func (wh *wrapperHandle) GetCustomContext(ctx *gin.Context) *define.Context { | ||||||
| 	return define.NewContext(ctx) | 	return define.NewContext(ctx) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // GetTraceInstance 获取trace实例 | ||||||
|  | func (wh *wrapperHandle) GetTraceInstance(ctx *gin.Context) *trace.Runtime { | ||||||
|  | 	return define.NewContext(ctx).Trace | ||||||
|  | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user