1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

more improvements to the x/client new sub-package

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-01-23 01:21:31 +02:00
parent 4a1f0b6e9e
commit 4899fe95f4
5 changed files with 159 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package main
import (
"context"
"fmt"
"github.com/kataras/iris/v12/_examples/http-client/weatherapi/client"
)
func main() {
c := client.NewClient(client.Options{
APIKey: "{YOUR_API_KEY_HERE}",
})
resp, err := c.GetCurrentByCity(context.Background(), "Xanthi/GR")
if err != nil {
panic(err)
}
fmt.Printf("Temp: %.2f(C), %.2f(F)\n", resp.Current.TempC, resp.Current.TempF)
}