Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deadlysurgeon/weather
Weather Service Coding Challenge
https://github.com/deadlysurgeon/weather
Last synced: 11 days ago
JSON representation
Weather Service Coding Challenge
- Host: GitHub
- URL: https://github.com/deadlysurgeon/weather
- Owner: DeadlySurgeon
- Created: 2024-03-26T16:22:42.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-02T20:10:30.000Z (9 months ago)
- Last Synced: 2024-04-02T21:28:04.261Z (9 months ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Weather Service Coding Challenge
Coding challenge for a basic weather service API caller. Currently uses REST and
is exposed over at `/weather/at` with query parameters `lat` and `lon`.## Environmental Variable Configuration
This program is configured based off of environmental variables as described
below. They can be set ahead of time or in a .env file, which an `example.env`
is included.| ENV | Desc |
| ---------------- | --------------------------------- |
| Net | Network based configuration |
| NET_BIND | Network address binding |
| NET_TLSCERT | TLS Certificate Pem file location |
| NET_TLSKEY | TLS Key Pem file location |
| | |
| Weather | Weather service configuration |
| WEATHER_ENDPOINT | Endpoint to hit |
| WEATHER_APIKEY | API Key for openweathermap.org |## API
**Endpoint**: `{SERVICE}/weather/at`
**Query Params:**:| Key | Type | Desc |
| ----- | ------- | ------------------------------------------ |
| `lat` | float64 | Latitude you want to check the weather of |
| `lon` | float64 | Longitude you want to check the weather of |**Response**:
```jsonc
{
"condition": "[snow|rain|thunder]", // This is up to the openweatherapi condition field
"temperature": "[freezing|cold|moderate|hot|burning]",
"temperature_raw": 0 // float32 in metric
}
```