mirror of
https://codeberg.org/andyscott/OpenWeather-gRPC-API.git
synced 2024-12-21 12:13:09 -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) {
|
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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue