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

29 lines
538 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 doFiveDay(c pb.WeatherServiceClient) {
res, err := c.FiveDay(context.Background(), &pb.RequestFiveDay{
2022-09-02 22:50:27 -04:00
LocationType: pb.LocationType_LOCATION_TYPE_COORDS,
Units: pb.Units_UNITS_IMPERIAL,
Location: &pb.OneOfLocation{
2022-09-02 22:50:27 -04:00
LocationId: &pb.OneOfLocation_Coords{
Coords: &pb.Coordinates{
Latitude: 41,
Longitude: -123,
},
},
},
})
if err != nil {
log.Fatalln(err)
}
log.Println(res.Payload)
}