This is a drone navigation service whose primary goal is to help a drone retrieve the location of a databank.
- There are sectors of galaxies (referred to
sectors
here) that when passed coordinates (x,y and z
) and velocity, can return locations of databanks on these sectors. - A
JWT
is used to authenticate requests to the endpoint. - A
droneID
is part of theJWT
claims. - The
droneID
can then be used to retrieve the drone details (from a database) which contain most importantly, thesectorID
needed to calculate the location. This retrieval is mocked in this service.
- A drone can be embedded with a JWT that can be used to retrieve location of a databank
- A drone can authenticate with DNS, generate a JWT that can be used to make a call to retrieve location of a databank
- Make a
GET
call to/locations
with query parameters (coords and velocity). Please see postman collection inpostman
folder - Pass a bearer token containing
droneID
as part of its claims. You can generate one here - http://jwtbuilder.jamiekurtz.com/ - Please note that retrieval of drone details is mocked in
internal/db.go
to return a constant value. A furistic implementation would be to use a relational database wheresectors
are stored (with theid
set as primary key) and then, the function ininternal\db.go
can query theDB
to return thesectorID
- This endpoint should return a response in this form
{
"loc": 113.23999999999998
}
$ go build -o main ./cmd/drones
$ make test
$ make run
$ docker build -t drones-api .
$ docker run -p 8000:9064 drones-api
The OpenAPI spec for this service can be found in the open-api.yaml
file. Upload to https://editor.swagger.io/ to view.
The Postman collection can be found in the postman
folder