https://github.com/mohan3d/apixu-go
Golang library for Apixu Weather API http://www.apixu.com
https://github.com/mohan3d/apixu-go
api-client api-wrapper apixu client go golang wrapper
Last synced: 5 months ago
JSON representation
Golang library for Apixu Weather API http://www.apixu.com
- Host: GitHub
- URL: https://github.com/mohan3d/apixu-go
- Owner: mohan3d
- License: mit
- Created: 2017-09-13T19:12:04.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-11T22:52:12.000Z (about 8 years ago)
- Last Synced: 2024-06-20T01:56:07.849Z (almost 2 years ago)
- Topics: api-client, api-wrapper, apixu, client, go, golang, wrapper
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# apixu-go
[](https://godoc.org/github.com/mohan3d/apixu-go)
[](https://travis-ci.org/mohan3d/apixu-go)
[](https://goreportcard.com/report/github.com/mohan3d/apixu-go)
Golang library for Apixu Weather API http://www.apixu.com
## Installation
```bash
$ go get github.com/mohan3d/apixu-go
```
## Usage
```go
package main
import (
"fmt"
"github.com/mohan3d/apixu-go"
)
func main() {
client := apixu.NewClient("")
current, err := client.Current("Paris")
if err != nil {
panic(err)
}
fmt.Printf("%v °C, %v °F\n", current.Current.TempC, current.Current.TempF)
forecast, err := client.Forecast("London", 3)
if err != nil {
panic(err)
}
fmt.Printf("%v\n", forecast.Location.Country)
}
```
## Testing
**APIXU_KEY** must be exported to environment variables before running tests.
```bash
$ export APIXU_KEY=
```