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

27 lines
530 B
Go
Raw Normal View History

package main
import (
"context"
"log"
2024-06-19 12:51:47 -04:00
pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
)
func doCurrent(c pb.WeatherServiceClient) {
res, err := c.Current(context.Background(), &pb.RequestCurrent{
2022-09-02 22:50:27 -04:00
LocationType: pb.LocationType_LOCATION_TYPE_COORDS,
Units: pb.Units_UNITS_UNSPECIFIED,
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)
}