2022-07-26 17:28:33 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"log"
|
|
|
|
|
2024-06-19 12:51:47 -04:00
|
|
|
pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
|
2022-07-26 17:28:33 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func doLocation(c pb.WeatherServiceClient) {
|
|
|
|
|
|
|
|
res, err := c.Location(context.Background(), &pb.RequestLocation{
|
2022-09-01 02:12:04 -04:00
|
|
|
LocationType: pb.LocationType_LOCATION_TYPE_CITY,
|
|
|
|
Location: &pb.OneOfLocation{
|
2022-09-01 22:51:36 -04:00
|
|
|
LocationId: &pb.OneOfLocation_City{
|
2022-09-02 22:52:40 -04:00
|
|
|
City: "Seattle",
|
2022-09-01 22:51:36 -04:00
|
|
|
},
|
|
|
|
},
|
2022-07-26 17:28:33 -04:00
|
|
|
})
|
2022-09-01 02:12:04 -04:00
|
|
|
|
2022-07-26 17:28:33 -04:00
|
|
|
if err != nil {
|
|
|
|
log.Fatalln(err)
|
|
|
|
}
|
|
|
|
log.Printf("Latitude: %v, Longitude: %v\n", res.Latitude, res.Longitude)
|
|
|
|
}
|