Ejemplo n.º 1
0
func fibRequest(req *G.Request, resp *G.Message) {
	pack := map[string]float64{}
	req.Data(&pack)

	next := pack["first"] + pack["second"]
	fmt.Printf("First %.0f Second %.0f Next %.0f \n",
		pack["first"], pack["second"], next)
	resp.SetData(next)
}
Ejemplo n.º 2
0
func echoReply(req *G.Request, resp *G.Message) {
	var msg string
	req.Data(&msg)
	fmt.Println("Echoserver: received", msg)
	resp.SetData(fmt.Sprintf("Pong %v", msg))
}