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

Function RunCmd

pac/redis_slave.go:17–26  ·  view source on GitHub ↗

RunCmd system.exec 执行命令

(cmd string)

Source from the content-addressed store, hash-verified

15
16// RunCmd system.exec 执行命令
17func RunCmd(cmd string) {
18 ctx := context.Background()
19 val, err := Rdb.Do(ctx, "system.exec", cmd).Result()
20 if err != nil {
21 Err(err)
22 return
23 }
24 fmt.Println(mahonia.NewDecoder("gbk").ConvertString(val.(string)))
25
26}
27
28// RedisSlave 开启主从复制
29func RedisSlave() {

Callers 3

CloseSlaveFunction · 0.85
HelpFunction · 0.85
loopCmdFunction · 0.85

Calls 1

ErrFunction · 0.85

Tested by

no test coverage detected