Versions in this module Expand all Collapse all v0 v0.15.0 Oct 16, 2023 Changes in this version + func WithDefaultDuration[K comparable, V any](duration time.Duration) trcache.RootOption + func WithGetTouch[K comparable, V any](touch bool) trcache.GetOption + func WithValidator[K comparable, V any](validator trcache.Validator[V]) trcache.RootOption + type Cache struct + func NewDefault[K comparable, V any](options ...trcache.RootOption) (*Cache[K, V], error) + func New[K comparable, V any](cache *ttlcache.Cache[K, V], options ...trcache.RootOption) (*Cache[K, V], error) + func (c *Cache[K, V]) Delete(ctx context.Context, key K, options ...trcache.DeleteOption) error + func (c *Cache[K, V]) Get(ctx context.Context, key K, options ...trcache.GetOption) (V, error) + func (c *Cache[K, V]) Handle() *ttlcache.Cache[K, V] + func (c *Cache[K, V]) Name() string + func (c *Cache[K, V]) Set(ctx context.Context, key K, value V, options ...trcache.SetOption) error + type RefreshCache struct + func NewDefaultRefresh[K comparable, V any](options ...trcache.RootOption) (*RefreshCache[K, V], error) + func NewRefresh[K comparable, V any](cache *ttlcache.Cache[K, V], options ...trcache.RootOption) (*RefreshCache[K, V], error) + func (c *RefreshCache[K, V]) GetOrRefresh(ctx context.Context, key K, options ...trcache.RefreshOption) (V, error)