1
0
Fork 0

Unit debug tool

This commit is contained in:
Gregory Eremin 2015-02-11 02:40:21 +07:00
parent d88b952e9d
commit 1b9721825d
2 changed files with 25 additions and 16 deletions

View File

@ -1,16 +0,0 @@
package main
import (
"fmt"
"github.com/localhots/yeast/unit"
)
func main() {
u := unit.New("uuid")
msg := []byte("{}")
fmt.Println("Sending message:", string(msg))
resp, _ := u.Send(msg)
fmt.Println("Reply recieved:", string(resp))
}

25
unit_send.go Normal file
View File

@ -0,0 +1,25 @@
package main
import (
"flag"
"fmt"
"github.com/localhots/yeast/unit"
)
func main() {
var (
name string
msg string
)
flag.StringVar(&name, "unit", "", "Unit name")
flag.StringVar(&msg, "msg", "", "Message")
flag.Parse()
u := unit.New(name)
fmt.Println("Sending message:", msg)
resp, _ := u.Call([]byte(msg))
fmt.Println("Reply recieved:", string(resp))
}