获取 Redis 基本信息
()
| 41 | |
| 42 | // 获取 Redis 基本信息 |
| 43 | func redisVersion() bool { |
| 44 | info := RedisCmd("info") |
| 45 | if strings.Contains(info.(string), "redis_version") { |
| 46 | Info("获取 Redis 基本信息") |
| 47 | os := ReString(info, "os:.*") |
| 48 | version := ReString(info, "redis_version:.*") |
| 49 | Success(os) |
| 50 | Success(version) |
| 51 | dir := RedisCmd("config get dir") |
| 52 | redisDir = redisString(dir)[4:] |
| 53 | Success(redisDir) |
| 54 | |
| 55 | file := RedisCmd("config get dbfilename") |
| 56 | redisDbFilename = redisString(file)[11:] |
| 57 | Success(redisDbFilename) |
| 58 | return true |
| 59 | } |
| 60 | return false |
| 61 | } |
| 62 | |
| 63 | // 循环执行shell命令 |
| 64 | func loopCmd(s string) { |
no test coverage detected