Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMemoryNotFound = errors.New("memory not found") ErrRedisNotFound = errors.New("redis not found") )
Functions ¶
This section is empty.
Types ¶
type DefaultMemoryCacheImpl ¶
type DefaultMemoryCacheImpl[K comparable, V any] struct { // contains filtered or unexported fields }
func (DefaultMemoryCacheImpl[K, V]) DelItem ¶
func (d DefaultMemoryCacheImpl[K, V]) DelItem(c context.Context, k string) error
type DefaultRedisCacheImpl ¶
type DefaultRedisCacheImpl[K comparable, V any] struct { // contains filtered or unexported fields }
func (DefaultRedisCacheImpl[K, V]) DelItem ¶
func (d DefaultRedisCacheImpl[K, V]) DelItem(c context.Context, k string) error
type FusionCache ¶
type FusionCache[K comparable, V any] struct { // contains filtered or unexported fields }
func New ¶
func New[K comparable, V any](mc MemoryCache[K, V], rc RedisCache[K, V]) *FusionCache[K, V]
func NewDefaultFusionCache ¶
type Loader ¶
type Loader[K comparable, V any] func(K) (V, error)
type MemoryCache ¶
type MemoryCache[K comparable, V any] interface { Cache[K, V] }
func NewDefaultMemoryCache ¶
func NewDefaultMemoryCache(defaultExpiration, cleanupInterval time.Duration) MemoryCache[string, string]
type RedisCache ¶
type RedisCache[K comparable, V any] interface { Cache[K, V] }
func NewDefaultRedisCache ¶
func NewDefaultRedisCache(dsn string) RedisCache[string, string]
func NewDefaultRedisCacheV2 ¶
func NewDefaultRedisCacheV2(cli *redis.Client) RedisCache[string, string]
Click to show internal directories.
Click to hide internal directories.