MCPcopy Create free account
hub / github.com/Hel10-Web/Databasetools / redisVersion

Function redisVersion

pac/redis_cmd.go:43–61  ·  view source on GitHub ↗

获取 Redis 基本信息

()

Source from the content-addressed store, hash-verified

41
42// 获取 Redis 基本信息
43func 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命令
64func loopCmd(s string) {

Callers 1

RedisClientFunction · 0.85

Calls 5

RedisCmdFunction · 0.85
InfoFunction · 0.85
ReStringFunction · 0.85
SuccessFunction · 0.85
redisStringFunction · 0.85

Tested by

no test coverage detected