Documentation ¶ Index ¶ type Cache func (c *Cache[K, T]) Discard(key K) func (c *Cache[K, T]) Lookup(key K, pol Policy) *T type Policy func (v Policy) String() string Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Cache ¶ type Cache[K comparable, T any] struct { Make func(K) *T // contains filtered or unexported fields } func (*Cache[K, T]) Discard ¶ func (c *Cache[K, T]) Discard(key K) func (*Cache[K, T]) Lookup ¶ func (c *Cache[K, T]) Lookup(key K, pol Policy) *T type Policy ¶ type Policy int const ( Available Policy = iota // Available accepts a stale value if available Fresh // Fresh insists on waiting for the latest value if update is running UpdateNow // UpdateNow initiates an update ) func (Policy) String ¶ func (v Policy) String() string Source Files ¶ View all Source files longtermcache.go Click to show internal directories. Click to hide internal directories.