Update test client for new/advanced query opts

This commit is contained in:
Andrew Scott 2022-09-01 02:12:04 -04:00
parent 8f7897d41b
commit 98ffd3b02b
Signed by: a
GPG key ID: 3EB62D0BBB8DB381
3 changed files with 20 additions and 6 deletions

View file

@ -10,7 +10,13 @@ import (
func doCurrent(c pb.WeatherServiceClient) { func doCurrent(c pb.WeatherServiceClient) {
res, err := c.Current(context.Background(), &pb.RequestCurrent{ res, err := c.Current(context.Background(), &pb.RequestCurrent{
City: "Corvallis", LocationType: pb.LocationType_LOCATION_TYPE_ZIP_CODE,
Units: pb.Units_UNITS_METRIC,
Location: &pb.OneOfLocation{
LocationId: &pb.OneOfLocation_ZipCode{
ZipCode: "97330",
},
},
}) })
if err != nil { if err != nil {
log.Fatalln(err) log.Fatalln(err)

View file

@ -7,11 +7,16 @@ import (
pb "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto" pb "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto"
) )
func doExtended(c pb.WeatherServiceClient) { func doFiveDay(c pb.WeatherServiceClient) {
res, err := c.Extended(context.Background(), &pb.RequestExtended{ res, err := c.FiveDay(context.Background(), &pb.RequestFiveDay{
City: "Corvallis", LocationType: pb.LocationType_LOCATION_TYPE_CITY,
Days: 7, Units: pb.Units_UNITS_IMPERIAL,
Location: &pb.OneOfLocation{
LocationId: &pb.OneOfLocation_City{
City: "Corvalls",
},
},
}) })
if err != nil { if err != nil {
log.Fatalln(err) log.Fatalln(err)

View file

@ -10,8 +10,11 @@ import (
func doLocation(c pb.WeatherServiceClient) { func doLocation(c pb.WeatherServiceClient) {
res, err := c.Location(context.Background(), &pb.RequestLocation{ res, err := c.Location(context.Background(), &pb.RequestLocation{
City: "Corvallis", LocationType: pb.LocationType_LOCATION_TYPE_CITY,
Location: &pb.OneOfLocation{
LocationId: &pb.OneOfLocation_City{City: "Corvallis"}},
}) })
if err != nil { if err != nil {
log.Fatalln(err) log.Fatalln(err)
} }