|
|
@ -229,3 +229,39 @@ func HExists(key, field string) (int64, error) { |
|
|
|
return redisdb.Int64(reply, nil) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* hash 键名 |
|
|
|
*/ |
|
|
|
func HKeys(key string) ([]string, error) { |
|
|
|
c := GetConn() |
|
|
|
|
|
|
|
ret, err := c.Do("HKEYS", key) |
|
|
|
|
|
|
|
reply := make([]string, 0) |
|
|
|
|
|
|
|
if err == nil { |
|
|
|
reply, err = redisdb.Strings(ret, err) |
|
|
|
} |
|
|
|
CloseConn(c) |
|
|
|
return reply, err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* hash 键值 |
|
|
|
*/ |
|
|
|
func HVals(key string) ([]string, error) { |
|
|
|
c := GetConn() |
|
|
|
|
|
|
|
ret, err := c.Do("HVALS", key) |
|
|
|
|
|
|
|
reply := make([]string, 0) |
|
|
|
|
|
|
|
if err == nil { |
|
|
|
reply, err = redisdb.Strings(ret, err) |
|
|
|
} |
|
|
|
CloseConn(c) |
|
|
|
return reply, err |
|
|
|
|
|
|
|
} |