示例#1
0
文件: hive.go 项目: jtanderson/hive
func showEnlisted(q *queen.Queen) {
	table := tablewriter.NewWriter(os.Stdout)
	table.SetHeader([]string{"Id", "Address", "Status"})

	for _, v := range q.GetDrones() {
		table.Append([]string{v.Id, v.Address, ""})
	}

	table.Render()
}
示例#2
0
文件: hive.go 项目: jtanderson/hive
func runQueen() {
	q := new(queen.Queen)

	/* Delete this madness eventually */
	q.EnlistDrone("127.0.0.1:1234")
	d := q.GetDrone(0)
	args := &drone.Args{7, 8}
	var reply string
	err := d.GetClient().Call("Drone.MyCall", args, &reply)
	if err != nil {
		log.Fatal("dialing:", err)
	}
	fmt.Println("Called MyCall to get:", reply)
	/* ------------------- */

	showEnlisted(q)
}