1
0
Fork 0
yeast/unit_send.go

26 lines
377 B
Go
Raw Normal View History

2015-02-10 19:40:21 +00:00
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))
}