mirror of
https://codeberg.org/andyscott/OpenWeather-gRPC-API.git
synced 2024-11-09 06:00:49 -05:00
26 lines
478 B
Go
26 lines
478 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
|
|
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
|
|
)
|
|
|
|
func doCurrent(c pb.WeatherServiceClient) {
|
|
|
|
res, err := c.Current(context.Background(), &pb.RequestCurrent{
|
|
LocationType: pb.LocationType_LOCATION_TYPE_CITY,
|
|
Units: pb.Units_UNITS_METRIC,
|
|
Location: &pb.OneOfLocation{
|
|
LocationId: &pb.OneOfLocation_City{
|
|
City: "Corvallis",
|
|
},
|
|
},
|
|
})
|
|
if err != nil {
|
|
log.Fatalln(err)
|
|
}
|
|
|
|
log.Println(res.Payload)
|
|
}
|