MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / Cache

Method Cache

lib/localcache/cache.go:56–66  ·  view source on GitHub ↗

Cache stores a value in the cache.

(
	_ context.Context,
	key K,
	in V,
)

Source from the content-addressed store, hash-verified

54 continue
55 }
56 newInner := make(map[K2]V, len(inner))
57 maps.Copy(newInner, inner)
58 out[k] = newInner
59 }
60
61 return out
62 }
63}
64
65// LocalDataCache is an in-memory thread safe cache.
66// It uses generics so that users of it can uses any type of data they want.
67// The key K must be of type comparable. More infomration here: https://go.dev/blog/comparable
68// The value V can be any type.
69type LocalDataCache[K comparable, V any] struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected