OpenWeather-gRPC-API/test-client/extended.go
2022-09-01 23:43:01 -04:00

25 lines
486 B
Go

package main
import (
"context"
"log"
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
)
func doFiveDay(c pb.WeatherServiceClient) {
res, err := c.FiveDay(context.Background(), &pb.RequestFiveDay{
LocationType: pb.LocationType_LOCATION_TYPE_UNSPECIFIED,
Units: pb.Units_UNITS_METRIC,
Location: &pb.OneOfLocation{
LocationId: &pb.OneOfLocation_ZipCode{
ZipCode: "97330",
},
},
})
if err != nil {
log.Fatalln(err)
}
log.Println(res.Payload)
}