Skip to content

Commit 774ce3c

Browse files
HDel function added
1 parent b56326f commit 774ce3c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/redis/redis.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type RedisClient interface {
1515
Del(ctx context.Context, keys ...string) *redis.IntCmd
1616
Scan(ctx context.Context, cursor uint64, match string, count int64) *redis.ScanCmd
1717
HSet(ctx context.Context, key string, values ...interface{}) *redis.IntCmd
18+
HDel(ctx context.Context, key string, fields ...string) *redis.IntCmd
1819
RPush(ctx context.Context, key string, value interface{}) *redis.IntCmd
1920
LRange(ctx context.Context, key string, start, stop int64) *redis.StringSliceCmd
2021
PSubscribe(ctx context.Context, patterns ...string) (*redis.PubSub, error)
@@ -80,6 +81,11 @@ func (r *redisClient) HSet(ctx context.Context, key string, values ...interface{
8081
return r.client.HSet(ctx, key, values...)
8182
}
8283

84+
/* hash delete for redis */
85+
func (r *redisClient) HDel(ctx context.Context, key string, fields ...string) *redis.IntCmd {
86+
return r.client.HDel(ctx, key, fields...)
87+
}
88+
8389
/* subscribe to redis keyspace notifications */
8490
func (r *redisClient) PSubscribe(ctx context.Context, patterns ...string) (*redis.PubSub, error) {
8591
pubsub := r.client.PSubscribe(ctx, patterns...)

0 commit comments

Comments
 (0)