MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / GetCachedRkeyInfo

Method GetCachedRkeyInfo

client/cache.go:137–152  ·  view source on GitHub ↗

GetCachedRkeyInfo 获取指定类型的RKey信息(缓存)

(rkeyType entity.RKeyType)

Source from the content-addressed store, hash-verified

135
136// GetCachedRkeyInfo 获取指定类型的RKey信息(缓存)
137func (c *QQClient) GetCachedRkeyInfo(rkeyType entity.RKeyType) *entity.RKeyInfo {
138 refresh := c.cache.RkeyInfoCacheIsEmpty()
139 for {
140 if refresh {
141 if err := c.RefreshAllRkeyInfoCache(); err != nil {
142 return nil
143 }
144 }
145 inf := c.cache.GetRKeyInfo(rkeyType)
146 if inf.ExpireTime <= uint64(time.Now().Unix()) {
147 refresh = true
148 continue
149 }
150 return inf
151 }
152}
153
154// GetCachedRkeyInfos 获取所有RKey信息(缓存)
155func (c *QQClient) GetCachedRkeyInfos() map[entity.RKeyType]*entity.RKeyInfo {

Callers 2

QueryGroupImageMethod · 0.95
QueryFriendImageMethod · 0.95

Calls 3

RkeyInfoCacheIsEmptyMethod · 0.80
GetRKeyInfoMethod · 0.80

Tested by

no test coverage detected