Documentation ¶
Index ¶
- Constants
- func CustomGetTraceIdContext(ctx context.Context, key string) string
- func CustomTraceIdContext(ctx context.Context) context.Context
- func GetGinTraceId(c *gin.Context) string
- func GetTraceIdContext(ctx context.Context) string
- func SetCustomTraceId(ctx context.Context, traceId string) context.Context
- func SetGinTraceId() gin.HandlerFunc
- func SetGinTraceIdContext(ctx context.Context, c *gin.Context) context.Context
Constants ¶
View Source
const ( TraceIdKey = "trace_id" TraceIdGinKey = "trace_id" TraceIdRequestKey = "X-Request-Id" TraceIDRequestKey = "X-Request-ID" )
View Source
const Nil = "%!s(<nil>)"
View Source
const Version = "1.0.12"
Variables ¶
This section is empty.
Functions ¶
func CustomGetTraceIdContext ¶ added in v1.0.12
CustomGetTraceIdContext 通过自定义上下文获取跟踪编号
func CustomTraceIdContext ¶
CustomTraceIdContext 自定义设置跟踪编号上下文
func GetTraceIdContext ¶
GetTraceIdContext 通过上下文获取跟踪编号
func SetCustomTraceId ¶ added in v1.0.6
SetCustomTraceId 自定义设置跟踪编号上下文
func SetGinTraceId ¶
func SetGinTraceId() gin.HandlerFunc
SetGinTraceId 设置跟踪编号 https://www.jianshu.com/p/2a1a74ad3c3a
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.