This commit is contained in:
2025-04-14 15:28:51 +08:00
parent f100427f8b
commit 371b89ee8d
93 changed files with 3757 additions and 1038 deletions

View File

@@ -15,7 +15,7 @@ import (
var ErrRedisKeyNotFound = errors.New("redis key not found")
type IRedis interface {
type RedisCache interface {
Encode(a any) ([]byte, error)
Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
Del(ctx context.Context, keys ...string) error
@@ -30,7 +30,7 @@ type redisCache struct {
engine *redis.Client
}
var _ IRedis = (*redisCache)(nil)
var _ RedisCache = (*redisCache)(nil)
func New(conf config.Redis) (*redisCache, error) {
rdb := redis.NewClient(&redis.Options{