There are over 100,000 flights a day, with millions of people and cargo being transferred around the world. With so many people, and different carrier/agency groups it can be hard to track where a person might be. In order to determine the flight path of a person, we must sort through all of their flight records.
To create a microservice API that can help us understand and track how a particular person’s flight path may be queried. The API should accept a request that includes a list of flights, which are defined by a source and destination airport code. These flights may not be listed in order and will need to be sorted to find the total flight paths starting and ending airports.
- go 1.16+
-
Clone the repo
git clone https://github.com/kumareswaramoorthi/flight-paths-tracker.git
-
Navigate to project directory
cd flight-paths-tracker
-
Build the application by following command
go build -o flight-paths-tracker main.go
-
Run the application by the following command
./flight-paths-tracker
Alternatively, using docker,
-
Clone the repo
git clone https://github.com/kumareswaramoorthi/flight-paths-tracker.git
-
Navigate to project directory
cd flight-paths-tracker
-
Build the docker image by following command
docker build -t flight-paths-tracker:1.0 .
-
Run the application by the following command
docker run -p 8080:8080 flight-paths-tracker:1.0
Swagger UI can be accessed at http://127.0.0.1:8080/swagger/index.html
All URIs are relative to http://127.0.0.1:8080
Method | HTTP request | Description |
---|---|---|
FindSourceAndDestination | POST /track | Finds source and destination from tickets |
JSON body containing array of tickets.
Array of string containing source and destination
- Content-Type: application/json
- Accept: application/json
- Request:
curl -H "Content-type: application/json" -d '{"tickets": [["ATL", "EWR"], ["SFO", "ATL"]]}' 127.0.0.1:8080/track
- Response:
["SFO","EWR"]
Method | HTTP request | Description |
---|---|---|
HealthCheck | GET / | Health Check API |
This endpoint does not need any parameter.
HTTP Status 200.