|
|
@ -1,10 +1,10 @@ |
|
|
|
package utils |
|
|
|
package utils |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"net" |
|
|
|
"bytes" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"net" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"bytes" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"pkg/libs/bytesize" |
|
|
|
"pkg/libs/bytesize" |
|
|
|
"redis-shake/configure" |
|
|
|
"redis-shake/configure" |
|
|
@ -26,7 +26,7 @@ const ( |
|
|
|
|
|
|
|
|
|
|
|
TencentCluster = "tencent_cluster" |
|
|
|
TencentCluster = "tencent_cluster" |
|
|
|
AliyunCluster = "aliyun_cluster" |
|
|
|
AliyunCluster = "aliyun_cluster" |
|
|
|
UCloudCluster = "ucloud_cluster" |
|
|
|
UCloudCluster = "ucloud_cluster" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
var ( |
|
|
@ -56,7 +56,7 @@ func ReadRESPEnd(c net.Conn) (string, error) { |
|
|
|
func RemoveRESPEnd(input string) string { |
|
|
|
func RemoveRESPEnd(input string) string { |
|
|
|
length := len(input) |
|
|
|
length := len(input) |
|
|
|
if length >= 2 { |
|
|
|
if length >= 2 { |
|
|
|
return input[: length - 2] |
|
|
|
return input[:length-2] |
|
|
|
} |
|
|
|
} |
|
|
|
return input |
|
|
|
return input |
|
|
|
} |
|
|
|
} |
|
|
@ -75,8 +75,8 @@ func ParseInfo(content []byte) map[string]string { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func GetTotalLink() int { |
|
|
|
func GetTotalLink() int { |
|
|
|
if len(conf.Options.SourceAddress) != 0 { |
|
|
|
if len(conf.Options.SourceAddressList) != 0 { |
|
|
|
return len(conf.Options.SourceAddress) |
|
|
|
return len(conf.Options.SourceAddressList) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return len(conf.Options.RdbInput) |
|
|
|
return len(conf.Options.RdbInput) |
|
|
|
} |
|
|
|
} |
|
|
|