Documentation ¶
Index ¶
- type XTraceClient
- func (t *XTraceClient) ToTraceContext(uCtx iris.Context) *context.Context
- func (t *XTraceClient) TraceIdFromContext(pCtx *context.Context) string
- func (t *XTraceClient) TraceTimePoint(pCtx *context.Context, eventName string)
- func (t *XTraceClient) TraceTimePrint(pCtx *context.Context) string
- func (t *XTraceClient) URIFromContext(pCtx *context.Context) string
- func (t *XTraceClient) UserIdFromContext(pCtx *context.Context) uint
- type XTraceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type XTraceClient ¶ added in v0.0.4
type XTraceClient struct { ContextKeyTrace string HeaderKeyTraceId string HeaderKeyTs string HeaderKeyAuthUserId string HeaderKeyUri string ByResponseHeader bool }
func GenXTraceClient ¶ added in v0.0.4
func GenXTraceClient(keyTrace string, headerKeyTraceId string, headerKeyTs string, headerKeyUri string, headerKeyAuthUserId string, byResponseHeader bool) XTraceClient
* keyTrace:trace信息存储key headerKeyTraceId:traceId在header中的KEY headerKeyTs:ts在header中的KEY headerKeyUri:uri在header中的KEY headerKeyAuthUserId:userId在header中的KEY byResponseHeader:是否从responseHeader里面读取
func (*XTraceClient) ToTraceContext ¶ added in v0.0.4
func (t *XTraceClient) ToTraceContext(uCtx iris.Context) *context.Context
* 获取一个带TraceInfo的Context环境变量
func (*XTraceClient) TraceIdFromContext ¶ added in v0.0.4
func (t *XTraceClient) TraceIdFromContext(pCtx *context.Context) string
* * 从Context环境变量中获取traceId
func (*XTraceClient) TraceTimePoint ¶ added in v0.0.4
func (t *XTraceClient) TraceTimePoint(pCtx *context.Context, eventName string)
* 时间统计插入点 uCtx 环境 eventName 事件名称或者步骤名称
func (*XTraceClient) TraceTimePrint ¶ added in v0.0.4
func (t *XTraceClient) TraceTimePrint(pCtx *context.Context) string
* 时间统计打印信息 uCtx 环境
func (*XTraceClient) URIFromContext ¶ added in v0.2.4
func (t *XTraceClient) URIFromContext(pCtx *context.Context) string
* * 从Context环境变量中获取uri
func (*XTraceClient) UserIdFromContext ¶ added in v0.0.4
func (t *XTraceClient) UserIdFromContext(pCtx *context.Context) uint
* * 从Context环境变量中获取userId
Click to show internal directories.
Click to hide internal directories.