Versions in this module Expand all Collapse all v1 v1.5.5 Oct 25, 2023 Changes in this version + var CacheNotFound = redis.Nil + var DefaultClient Cache + var DefaultExpireTime = time.Hour * 24 + var DefaultNotFoundExpireTime = time.Minute * 10 + var ErrPlaceholder = errors.New("cache: placeholder") + var ErrSetMemoryWithNotFound = errors.New("cache: set memory cache err for not found") + var NotFoundPlaceholder = "*" + func BuildCacheKey(keyPrefix string, key string) (string, error) + func Del(ctx context.Context, keys ...string) error + func Get(ctx context.Context, key string, val interface{}) error + func MultiGet(ctx context.Context, keys []string, valueMap interface{}) error + func MultiSet(ctx context.Context, valMap map[string]interface{}, expiration time.Duration) error + func Set(ctx context.Context, key string, val interface{}, expiration time.Duration) error + func SetCacheWithNotFound(ctx context.Context, key string) error + type Cache interface + Del func(ctx context.Context, keys ...string) error + Get func(ctx context.Context, key string, val interface{}) error + MultiGet func(ctx context.Context, keys []string, valueMap interface{}) error + MultiSet func(ctx context.Context, valMap map[string]interface{}, expiration time.Duration) error + Set func(ctx context.Context, key string, val interface{}, expiration time.Duration) error + SetCacheWithNotFound func(ctx context.Context, key string) error + func NewMemoryCache(keyPrefix string, encode encoding.Encoding, newObject func() interface{}) Cache + func NewRedisCache(client *redis.Client, keyPrefix string, encode encoding.Encoding, ...) Cache