2022-07-26 03:42:51 -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 03:42:51 -04:00
|
|
|
)
|
|
|
|
|
2022-09-01 02:12:04 -04:00
|
|
|
func doFiveDay(c pb.WeatherServiceClient) {
|
2022-07-26 03:42:51 -04:00
|
|
|
|
2022-09-01 02:12:04 -04:00
|
|
|
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,
|
2022-09-01 02:12:04 -04:00
|
|
|
Location: &pb.OneOfLocation{
|
2022-09-02 22:50:27 -04:00
|
|
|
LocationId: &pb.OneOfLocation_Coords{
|
|
|
|
Coords: &pb.Coordinates{
|
|
|
|
Latitude: 41,
|
|
|
|
Longitude: -123,
|
|
|
|
},
|
2022-09-01 02:12:04 -04:00
|
|
|
},
|
|
|
|
},
|
2022-07-26 03:42:51 -04:00
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
log.Fatalln(err)
|
|
|
|
}
|
|
|
|
log.Println(res.Payload)
|
|
|
|
}
|