OpenWeather-gRPC-API/test-client/current.go

27 lines
478 B
Go
Raw Normal View History

package main
import (
"context"
"log"
2022-09-01 23:43:01 -04:00
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
)
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,
Units: pb.Units_UNITS_METRIC,
Location: &pb.OneOfLocation{
2022-09-01 23:43:01 -04:00
LocationId: &pb.OneOfLocation_City{
City: "Corvallis",
},
},
})
if err != nil {
log.Fatalln(err)
}
log.Println(res.Payload)
}