| 1234567891011121314151617 |
- package redisx
- import "context"
- // 哈希封装
- func HSet(ctx context.Context, key string, values map[string]interface{}) error {
- return getClient().HSet(ctx, key, values).Err()
- }
- func HGet(ctx context.Context, key, field string) (string, error) {
- return getClient().HGet(ctx, key, field).Result()
- }
- func HGetAll(ctx context.Context, key string) (map[string]string, error) {
- return getClient().HGetAll(ctx, key).Result()
- }
|