Documentation
¶
Index ¶
- Variables
- func GenerateTraceId() string
- func GetGinContextTraceId(c *gin.Context) string
- func GetTraceId(ctx context.Context) string
- func GetTraceIdKey() string
- func SetTraceId(ctx context.Context, prefix string, traceId ...string) context.Context
- func SetTraceIdKey(traceIdKey string)
- type ContextKey
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TraceIdKey = "traceId"
)
Functions ¶
func GenerateTraceId ¶
func GenerateTraceId() string
GenerateTraceId return traceId creates and returns a global unique string in 32 bytes that meets most common usages without strict UUID algorithm. It returns a unique string using default unique algorithm if no `data` is given.
func GetGinContextTraceId ¶
GetGinContextTraceId get trace id from context
func GetTraceId ¶
func GetTraceIdKey ¶
func GetTraceIdKey() string
func SetTraceId ¶
func SetTraceIdKey ¶
func SetTraceIdKey(traceIdKey string)
Types ¶
type ContextKey ¶
type ContextKey string
func (ContextKey) String ¶
func (c ContextKey) String() string
Click to show internal directories.
Click to hide internal directories.