Send json command through sock in golang
var sock = NewSock("test.sock")
sock.OnCommand(func(cmd *Command) {
log.Println(cmd)
_ = cmd.ReplyOk()
})
err := sock.Listen()
if err != nil {
log.Fatal(err)
}
var sock = NewSock("test.sock")
_, err := sock.Send(&Command{
Code: "stop",
Params: map[string]interface{}{},
})
if err != nil {
log.Fatal(err)
}