mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 18:46:24 +05:00
14 lines
259 B
Go
14 lines
259 B
Go
package utils
|
|
|
|
import "fmt"
|
|
|
|
func GenRedisProtocol(cmd ...string) string {
|
|
proto := ""
|
|
proto += fmt.Sprintf("*%d\r\n", len(cmd))
|
|
for _, arg := range cmd {
|
|
proto += fmt.Sprintf("$%d\r\n", len(arg))
|
|
proto += fmt.Sprintf("%s\r\n", arg)
|
|
}
|
|
return proto
|
|
}
|