Versions in this module Expand all Collapse all v9 v9.0.0 Jan 24, 2023 Changes in this version + var ErrCacheMiss = errors.New("cache: key is missing") + type Cache struct + func New(opt *Options) *Cache + func (cd *Cache) Delete(ctx context.Context, key string) error + func (cd *Cache) DeleteFromLocalCache(key string) + func (cd *Cache) Exists(ctx context.Context, key string) bool + func (cd *Cache) Get(ctx context.Context, key string, value interface{}) error + func (cd *Cache) GetSkippingLocalCache(ctx context.Context, key string, value interface{}) error + func (cd *Cache) Marshal(value interface{}) ([]byte, error) + func (cd *Cache) Once(item *Item) error + func (cd *Cache) Set(item *Item) error + func (cd *Cache) Stats() *Stats + func (cd *Cache) Unmarshal(b []byte, value interface{}) error + type Item struct + Ctx context.Context + Do func(*Item) (interface{}, error) + Key string + SetNX bool + SetXX bool + SkipLocalCache bool + TTL time.Duration + Value interface{} + func (item *Item) Context() context.Context + type LocalCache interface + Del func(key string) + Get func(key string) ([]byte, bool) + Set func(key string, data []byte) + type MarshalFunc func(interface{}) ([]byte, error) + type Options struct + LocalCache LocalCache + Marshal MarshalFunc + Redis rediser + StatsEnabled bool + Unmarshal UnmarshalFunc + type Stats struct + Hits uint64 + Misses uint64 + type TinyLFU struct + func NewTinyLFU(size int, ttl time.Duration) *TinyLFU + func (c *TinyLFU) Del(key string) + func (c *TinyLFU) Get(key string) ([]byte, bool) + func (c *TinyLFU) Set(key string, b []byte) + func (c *TinyLFU) UseRandomizedTTL(offset time.Duration) + type UnmarshalFunc func([]byte, interface{}) error v9.0.0-beta.1 Sep 7, 2022 Other modules containing this package github.com/go-redis/cache github.com/go-redis/cache/v7 github.com/go-redis/cache/v8