(key string, increment int64)
| 27 | } |
| 28 | |
| 29 | func cacheIncrTokenQuota(key string, increment int64) error { |
| 30 | key = common.GenerateHMAC(key) |
| 31 | err := common.RedisHIncrBy(fmt.Sprintf("token:%s", key), constant.TokenFiledRemainQuota, increment) |
| 32 | if err != nil { |
| 33 | return err |
| 34 | } |
| 35 | return nil |
| 36 | } |
| 37 | |
| 38 | func cacheDecrTokenQuota(key string, decrement int64) error { |
| 39 | return cacheIncrTokenQuota(key, -decrement) |
no test coverage detected