MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / cacheSetTokenField

Function cacheSetTokenField

model/token_cache.go:42–49  ·  view source on GitHub ↗
(key string, field string, value string)

Source from the content-addressed store, hash-verified

40}
41
42func 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,如果缓存中不存在,则从数据库中获取
52func cacheGetTokenByKey(key string) (*Token, error) {

Callers

nothing calls this directly

Calls 2

GenerateHMACFunction · 0.92
RedisHSetFieldFunction · 0.92

Tested by

no test coverage detected