Documentation
¶
Overview ¶
Package trace 提供请求链路追踪上下文信息的存取。
设计约定:
- 本包只做「结构体 + context 存取」,不做任何 HTTP/gRPC/反射逻辑;
- ctx 中的 *Info 由网关入口中间件通过 WithInfo 写入, 各服务通过 GetInfo 读取,日志/grpcclient 自动提取并注入。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TraceIDFromCtx ¶
TraceIDFromCtx 从 ctx 读取 TraceID,未写入时返回空字符串。
Types ¶
Click to show internal directories.
Click to hide internal directories.