feat:完善redis封装

This commit is contained in:
Amnesia
2026-03-13 15:32:48 +08:00
parent 63c5ec7ac7
commit cf83e11778
2 changed files with 28 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ package redis
import (
"context"
"time"
"github.com/redis/go-redis/v9"
)
func (c *Client) GetBytes(ctx context.Context, key string) ([]byte, error) {
@@ -16,3 +18,7 @@ func (c *Client) SetBytes(ctx context.Context, key string, value []byte, ttl tim
func (c *Client) Del(ctx context.Context, key string) error {
return c.rdb.Del(ctx, key).Err()
}
func (c *Client) MGet(cacheCtx context.Context, cacheKeys ...string) *redis.SliceCmd {
return c.rdb.MGet(cacheCtx, cacheKeys...)
}