(key string, field string, value string)
| 40 | } |
| 41 | |
| 42 | func cacheSetTokenField(key string, field string, value string) error { |
| 43 | key = common.GenerateHMAC(key) |
| 44 | err := common.RedisHSetField(fmt.Sprintf("token:%s", key), field, value) |
| 45 | if err != nil { |
| 46 | return err |
| 47 | } |
| 48 | return nil |
| 49 | } |
| 50 | |
| 51 | // CacheGetTokenByKey 从缓存中获取 token,如果缓存中不存在,则从数据库中获取 |
| 52 | func cacheGetTokenByKey(key string) (*Token, error) { |
nothing calls this directly
no test coverage detected