Versions in this module Expand all Collapse all v18 v18.0.0 May 14, 2025 Changes in this version + type Cache struct + func New[K comparable, V any](expirationCheckPeriod time.Duration) *Cache[K, V] + func (c *Cache[K, V]) EvictEntry(key K, entry *Entry[V]) + func (c *Cache[K, V]) EvictExpiredEntries() + func (c *Cache[K, V]) GetOrCreateCacheEntry(key K) *Entry[V] + type CacheWithErr struct + func NewWithError[K comparable, V any](ttl, errTTL time.Duration, errCacher ErrCacher[K], tracer trace.Tracer, ...) *CacheWithErr[K, V] + func (c *CacheWithErr[K, V]) GetItem(ctx context.Context, key K, f GetItemDirectly[V]) (V, error) + type Entry struct + Expires time.Time + HasItem bool + Item V + func (e *Entry[V]) IsExpiredLocked(t time.Time) bool + func (e *Entry[V]) IsNeedRefreshLocked() bool + type ErrCacher interface + CacheError func(ctx context.Context, key K, err error, errTTL time.Duration) + GetError func(ctx context.Context, key K) error + type GetItemDirectly func() (V, error) v18.0.0-rc42 May 13, 2025 Other modules containing this package gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v14 gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v15 gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16 gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v17