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

Method Set

pkg/cache/cache.go:197–206  ·  view source on GitHub ↗
(_ context.Context, key K, value V)

Source from the content-addressed store, hash-verified

195}
196
197func (c *cache[K, V]) Set(_ context.Context, key K, value V) {
198 now := c.clock.Now()
199
200 c.otter.Set(key, swrEntry[V]{
201 Value: value,
202 Fresh: now.Add(c.fresh),
203 Stale: now.Add(c.stale),
204 Hit: Hit,
205 })
206}
207
208func (c *cache[K, V]) SetMany(ctx context.Context, values map[K]V) {
209 now := c.clock.Now()

Callers 5

RestoreMethod · 0.95
revalidateMethod · 0.95
SWRMethod · 0.95
SWRWithFallbackMethod · 0.95

Calls 3

NowMethod · 0.65
SetMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected