cache_key.go 430 B

123456789101112131415161718192021
  1. package constant
  2. import "one-api/common"
  3. // 使用函数来避免初始化顺序带来的赋值问题
  4. func RedisKeyCacheSeconds() int {
  5. return common.SyncFrequency
  6. }
  7. // Cache keys
  8. const (
  9. UserGroupKeyFmt = "user_group:%d"
  10. UserQuotaKeyFmt = "user_quota:%d"
  11. UserEnabledKeyFmt = "user_enabled:%d"
  12. UserUsernameKeyFmt = "user_name:%d"
  13. )
  14. const (
  15. TokenFiledRemainQuota = "RemainQuota"
  16. TokenFieldGroup = "Group"
  17. )