MCPcopy
hub / github.com/unkeyed/unkey / SetMany

Method SetMany

pkg/cache/cache.go:208–219  ·  view source on GitHub ↗
(ctx context.Context, values map[K]V)

Source from the content-addressed store, hash-verified

206}
207
208func (c *cache[K, V]) SetMany(ctx context.Context, values map[K]V) {
209 now := c.clock.Now()
210
211 for key, value := range values {
212 c.otter.Set(key, swrEntry[V]{
213 Value: value,
214 Fresh: now.Add(c.fresh),
215 Stale: now.Add(c.stale),
216 Hit: Hit,
217 })
218 }
219}
220
221func (c *cache[K, V]) get(_ context.Context, key K) (swrEntry[V], bool) {
222 v, ok := c.otter.Get(key)

Callers 2

SWRManyMethod · 0.95
revalidateManyMethod · 0.95

Calls 3

NowMethod · 0.65
SetMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected