2022-07-26 01:07:26 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"log"
|
|
|
|
|
2022-09-01 23:43:01 -04:00
|
|
|
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
|
2022-07-26 01:07:26 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func doCurrent(c pb.WeatherServiceClient) {
|
|
|
|
|
|
|
|
res, err := c.Current(context.Background(), &pb.RequestCurrent{
|
2022-09-01 23:43:01 -04:00
|
|
|
LocationType: pb.LocationType_LOCATION_TYPE_CITY,
|
2022-09-01 02:12:04 -04:00
|
|
|
Units: pb.Units_UNITS_METRIC,
|
|
|
|
Location: &pb.OneOfLocation{
|
2022-09-01 23:43:01 -04:00
|
|
|
LocationId: &pb.OneOfLocation_City{
|
|
|
|
City: "Corvallis",
|
2022-09-01 02:12:04 -04:00
|
|
|
},
|
|
|
|
},
|
2022-07-26 01:07:26 -04:00
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
log.Fatalln(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Println(res.Payload)
|
|
|
|
}
|