chore: standardize context keys with custom ContextKey type (#697)

* chore: standardize context keys with custom ContextKey type

* fix bug

* 使用Request.Context
This commit is contained in:
j2rong4cn
2025-07-14 23:55:17 +08:00
committed by GitHub
parent 2a4c546a8b
commit 0c461991f9
51 changed files with 253 additions and 219 deletions
+14 -2
View File
@@ -149,7 +149,19 @@ const (
)
// ContextKey is the type of context keys.
type ContextKey int
const (
NoTaskKey = "no_task"
ApiUrlKey = "api_url"
_ ContextKey = iota
NoTaskKey
ApiUrlKey
UserKey
MetaKey
MetaPassKey
ClientIPKey
ProxyHeaderKey
RequestHeaderKey
UserAgentKey
PathKey
)