mirror of
https://codeberg.org/andyscott/OpenWeather-gRPC-API.git
synced 2024-11-05 05:20:48 -05:00
25 lines
490 B
Go
25 lines
490 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
|
|
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
|
|
)
|
|
|
|
func doLocation(c pb.WeatherServiceClient) {
|
|
|
|
res, err := c.Location(context.Background(), &pb.RequestLocation{
|
|
LocationType: pb.LocationType_LOCATION_TYPE_CITY,
|
|
Location: &pb.OneOfLocation{
|
|
LocationId: &pb.OneOfLocation_City{
|
|
City: "Corvallis",
|
|
},
|
|
},
|
|
})
|
|
|
|
if err != nil {
|
|
log.Fatalln(err)
|
|
}
|
|
log.Printf("Latitude: %v, Longitude: %v\n", res.Latitude, res.Longitude)
|
|
}
|