- 更新 .gitignore 排除临时文件 - 添加 ops 监控相关配置项到 config.yaml - 更新 Go 依赖包(go.mod/go.sum) - 扩展 config.go 支持 ops 监控配置 - 新增上下文键定义(ClientRequestID)
17 lines
649 B
Go
17 lines
649 B
Go
// Package ctxkey 定义用于 context.Value 的类型安全 key
|
||
package ctxkey
|
||
|
||
// Key 定义 context key 的类型,避免使用内置 string 类型(staticcheck SA1029)
|
||
type Key string
|
||
|
||
const (
|
||
// ForcePlatform 强制平台(用于 /antigravity 路由),由 middleware.ForcePlatform 设置
|
||
ForcePlatform Key = "ctx_force_platform"
|
||
|
||
// ClientRequestID 客户端请求的唯一标识,用于追踪请求全生命周期(用于 Ops 监控与排障)。
|
||
ClientRequestID Key = "ctx_client_request_id"
|
||
|
||
// RetryCount 表示当前请求在网关层的重试次数(用于 Ops 记录与排障)。
|
||
RetryCount Key = "ctx_retry_count"
|
||
)
|