Documentation
¶
Index ¶
- type Cache
- func (c *Cache[S, T]) Clear()
- func (c *Cache[S, T]) Count() int
- func (c *Cache[S, T]) Delete(key S)
- func (c *Cache[S, T]) Flush()
- func (c *Cache[S, T]) Get(key S) (T, bool)
- func (c *Cache[S, T]) Has(key S) bool
- func (c *Cache[S, T]) Put(key S, value T)
- func (c *Cache[S, T]) PutWithExpiration(key S, value T, expiration time.Time)
- func (c *Cache[S, T]) PutWithTTL(key S, value T, ttl time.Duration)
- func (c *Cache[S, T]) Watch(ctx context.Context, interval time.Duration)
- type LoadingCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[S comparable, T any] struct { // contains filtered or unexported fields }
func (*Cache[S, T]) PutWithExpiration ¶
func (*Cache[S, T]) PutWithTTL ¶
type LoadingCache ¶
type LoadingCache[S comparable, T any] struct { // contains filtered or unexported fields }
func NewLoadingCache ¶
func NewLoadingCache[S comparable, T any](ctx context.Context, loader function.Loader[S, T], defaultTTL time.Duration) *LoadingCache[S, T]
func (*LoadingCache[S, T]) Get ¶
func (c *LoadingCache[S, T]) Get(key S) (T, bool)
func (*LoadingCache[S, T]) Set ¶
func (c *LoadingCache[S, T]) Set(key S, value T)
func (*LoadingCache[S, T]) SetWithTTL ¶
func (c *LoadingCache[S, T]) SetWithTTL(key S, value T, ttl time.Duration)
Click to show internal directories.
Click to hide internal directories.