config.go 366 B

12345678910111213
  1. package contextkey
  2. import (
  3. "net/http"
  4. "wechat-api/ent"
  5. )
  6. // 在包内定义全局键(通常在 vars 块或 init 函数中初始化)
  7. var (
  8. HttpResponseWriterKey = NewCtxKey[http.ResponseWriter]() // 管理http.ResponseWriter
  9. OpenapiTokenKey = NewCtxKey[string]() // 管理openai token
  10. AuthTokenInfoKey = NewCtxKey[*ent.ApiKey]()
  11. )