From 363888fd19dba51170174a2833c62ca6b3fbf9f8 Mon Sep 17 00:00:00 2001 From: Renato Almeida Date: Thu, 30 Nov 2023 21:15:35 +0000 Subject: [PATCH] feat(redis): Add delete method to redis (#158) --- pkg/redis/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/redis/client.go b/pkg/redis/client.go index b26ccef..0ff115a 100644 --- a/pkg/redis/client.go +++ b/pkg/redis/client.go @@ -14,6 +14,7 @@ import ( type RedisClient interface { Get(ctx context.Context, key string) *redis.StringCmd Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd + Del(ctx context.Context, keys ...string) *redis.IntCmd Publish(ctx context.Context, channel string, message interface{}) *redis.IntCmd Subscribe(ctx context.Context, channels ...string) *redis.PubSub Ping(ctx context.Context) *redis.StatusCmd @@ -103,6 +104,10 @@ func (c redisClientImpl) Set(ctx context.Context, key string, value interface{}, return c.get().Set(ctx, key, value, expiration) } +func (c redisClientImpl) Del(ctx context.Context, keys ...string) *redis.IntCmd { + return c.get().Del(ctx, keys...) +} + func (c redisClientImpl) Publish(ctx context.Context, channel string, message interface{}) *redis.IntCmd { return c.get().Publish(ctx, channel, message) }