Documentation
¶
Index ¶
- type Cache
- func (c *Cache[K, V]) Close() (err error)
- func (c *Cache[K, V]) Delete(ctx context.Context, key K) (err error)
- func (c *Cache[K, V]) DeleteExpired(ctx context.Context)
- func (c *Cache[K, V]) Get(ctx context.Context, key K) (v V, err error)
- func (c *Cache[K, V]) Keys() []K
- func (c *Cache[K, V]) Set(ctx context.Context, key K, value V, opts ...ItemOption) (err error)
- func (c *Cache[K, V]) SetNX(ctx context.Context, key K, value V, opts ...ItemOption) (b bool, err error)
- type Item
- type ItemOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] struct { // contains filtered or unexported fields }
func NewSimpleCache ¶
func (*Cache[K, V]) DeleteExpired ¶
type ItemOption ¶
type ItemOption func(*itemOptions)
func WithExpiration ¶
func WithExpiration(exp time.Duration) ItemOption
Click to show internal directories.
Click to hide internal directories.