(data map[string][]byte, ttl time.Duration)
| 92 | } |
| 93 | |
| 94 | func (l *LRUCache) SetMultiAsync(data map[string][]byte, ttl time.Duration) { |
| 95 | // store the data in the shared cache. |
| 96 | l.c.SetMultiAsync(data, ttl) |
| 97 | |
| 98 | l.mtx.Lock() |
| 99 | defer l.mtx.Unlock() |
| 100 | |
| 101 | expires := time.Now().Add(ttl) |
| 102 | for k, v := range data { |
| 103 | l.lru.Add(k, &Item{ |
| 104 | Data: v, |
| 105 | ExpiresAt: expires, |
| 106 | }) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func (l *LRUCache) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error { |
| 111 | err := l.c.Set(ctx, key, value, ttl) |
nothing calls this directly
no test coverage detected