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() }
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) }