mirror of
https://codeberg.org/andyscott/OpenWeather-gRPC-API.git
synced 2024-12-20 12:03:10 -05:00
Update test client for new/advanced query opts
This commit is contained in:
parent
8f7897d41b
commit
98ffd3b02b
3 changed files with 20 additions and 6 deletions
|
@ -10,7 +10,13 @@ import (
|
|||
func doCurrent(c pb.WeatherServiceClient) {
|
||||
|
||||
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 {
|
||||
log.Fatalln(err)
|
||||
|
|
|
@ -7,11 +7,16 @@ import (
|
|||
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{
|
||||
City: "Corvallis",
|
||||
Days: 7,
|
||||
res, err := c.FiveDay(context.Background(), &pb.RequestFiveDay{
|
||||
LocationType: pb.LocationType_LOCATION_TYPE_CITY,
|
||||
Units: pb.Units_UNITS_IMPERIAL,
|
||||
Location: &pb.OneOfLocation{
|
||||
LocationId: &pb.OneOfLocation_City{
|
||||
City: "Corvalls",
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
|
|
|
@ -10,8 +10,11 @@ import (
|
|||
func doLocation(c pb.WeatherServiceClient) {
|
||||
|
||||
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 {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue