Special thanks to openflights for making this high quality data readily available for use in multiple formats.
This repository contains:
- A gRPC proto spec & implementation for iata-finder
- A dataservice which fetches a .csv of airports and airline data from open flights, sanitizes and stores in a poor-mans memory cache
- A RPC server (in process)
I was having trouble finding an API that easily made available airport & airline codes with associated information for free. I thought I should use this chance to make my own project exploring some development concepts I have not yet had the chance to touch, such as API development, RPC, Docker, data scraping in Go, and Open Source.
Configs
Check the ./configs
directory for any .example.toml
files, copy them and drop the .example
. Fill out the values appropriately. Each config should have comments that explain what any non-obvious or standard values should be.
To start the service, run make
which handles the creation of the docker image and creates a container from it.
The server can be consumed by any RPC calling service. The .proto
file could be used to write a client for consumption. A testing tool like Evans CLI could be used to call services as a one-off, or for testing as you build your client.
An example of using Evans CLI to test could be like:
> make
> evans --host 0.0.0.0 rpc/iatafinder.proto
> call GetAirportIATA
> JFK # or other valid airport IATA code
{
"id": 3797,
"name": "John F Kennedy International Airport",
"city": "New York",
"country": "United States",
"iata": "JFK",
"icao": "KJFK",
"latitude": 40.63980103,
"longitude": -73.77890015,
"altitude": 13,
"timezone": "America/New_York",
"daylightSavingsTime": "A",
"type": "airport",
"source": "OurAirports"
}