Ejemplo n.º 1
0
// Area returns a list of services for the specifed city.
func (c *Services) Area(rqst *structs.NServiceRequest, resp *structs.NServicesResponse) error {
	fmt.Println(rqst)

	x, err := data.ServicesArea(rqst.Area)
	if err == nil {
		fmt.Printf("  resp: %p", resp)
		resp.AdpID = data.AdapterName()
		resp.Message = "OK"
		resp.Services = *x
		fmt.Printf("%s\n", spew.Sdump(resp))
	} else {
		fmt.Printf("[Area]: error: %s\n", err)
	}
	return err
}
Ejemplo n.º 2
0
// All fills resp with a list of services for the specifed city.
func (c *Services) All(rqst *structs.NServiceRequest, resp *structs.NServicesResponse) error {
	fmt.Println(rqst)

	x, err := data.ServicesAll()
	if err == nil {
		fmt.Printf("  resp: %p", resp)
		resp.AdpID = data.AdapterName()
		resp.Message = "OK"
		resp.Services = *x
		// time.Sleep(time.Second * 4)
		fmt.Printf("%s\n", spew.Sdump(resp))
	} else {
		fmt.Printf("[All]: error: %s\n", err)
	}
	return err
}