gotrace_id

package module
v1.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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.14"

Variables

This section is empty.

Functions

func CustomGetTraceIdContext

func CustomGetTraceIdContext(ctx context.Context, key string) string

CustomGetTraceIdContext 通过自定义上下文获取跟踪编号

func CustomTraceIdContext

func CustomTraceIdContext(ctx context.Context) context.Context

CustomTraceIdContext 自定义设置跟踪编号上下文

func GetGinTraceId

func GetGinTraceId(c *gin.Context) string

GetGinTraceId 通过gin中间件获取跟踪编号

func GetTraceIdContext

func GetTraceIdContext(ctx context.Context) string

GetTraceIdContext 通过上下文获取跟踪编号

func SetCustomTraceId

func SetCustomTraceId(ctx context.Context, traceId string) context.Context

SetCustomTraceId 自定义设置跟踪编号上下文

func SetGinTraceId

func SetGinTraceId() gin.HandlerFunc

SetGinTraceId 设置跟踪编号 https://www.jianshu.com/p/2a1a74ad3c3a

func SetGinTraceIdContext

func SetGinTraceIdContext(ctx context.Context, c *gin.Context) context.Context

SetGinTraceIdContext 设置跟踪编号上下文

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL