feat: implement auth local cache. (#3533)

* feat: add auth local cache.

* feat: implement auth local cache.

* feat: improve auth localcache.
This commit is contained in:
Monet Lee
2025-08-28 11:26:02 +08:00
committed by GitHub
parent 349a8cd9af
commit 6856a864d0
12 changed files with 230 additions and 24 deletions
+25
View File
@@ -0,0 +1,25 @@
package convert
func TokenMapDB2Pb(tokenMapDB map[string]int) map[string]int32 {
if tokenMapDB == nil {
return nil
}
tokenMapPB := make(map[string]int32, len(tokenMapDB))
for k, v := range tokenMapDB {
tokenMapPB[k] = int32(v)
}
return tokenMapPB
}
func TokenMapPb2DB(tokenMapPB map[string]int32) map[string]int {
if tokenMapPB == nil {
return nil
}
tokenMapDB := make(map[string]int, len(tokenMapPB))
for k, v := range tokenMapPB {
tokenMapDB[k] = int(v)
}
return tokenMapDB
}