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

Function loopRedis

pac/redis_cmd.go:88–101  ·  view source on GitHub ↗

循环执行 Redis 命令

()

Source from the content-addressed store, hash-verified

86
87// 循环执行 Redis 命令
88func loopRedis() {
89 Info("执行 Redis 命令")
90 reader := bufio.NewReader(os.Stdin)
91 for {
92 fmt.Printf("%s:%s> ", Rhost, Rport)
93 cmd, _ := reader.ReadString('\n')
94 cmd = strings.TrimRight(cmd, "\r\n")
95 if cmd == "exit" || cmd == "q" || cmd == "quit" {
96 break
97 }
98 // 执行命令
99 fmt.Println(RedisCmd(cmd))
100 }
101}

Callers 1

HelpFunction · 0.85

Calls 2

InfoFunction · 0.85
RedisCmdFunction · 0.85

Tested by

no test coverage detected