Arrival time service is responsible to define a minimal arrival time of available cars around a given location.
Requirements
- go version 1.13.1 or higher
- MongoDB version 4.2.1
Make targets:
make generate
- generate go-clients by its swagger-specificationmake test
- run linter and test suitemake run
- run service
-
Export config variables or create a
.env
file consists of configuration variables. Allowed config variables are:ARRIVAL_TIME_SERVICE_LISTEN_ADDR
- http-listener address in form ofhost:port
ARRIVAL_TIME_SERVICE_CAR_SERVICE_HOST
- cars-service hostARRIVAL_TIME_SERVICE_CAR_SERVICE_BASE_PATH
- cars-service base pathARRIVAL_TIME_SERVICE_CAR_SERVICE_LIMIT
- a limit of cars responded by cars-serviceARRIVAL_TIME_SERVICE_PREDICT_SERVICE_HOST
- prediction-service hostARRIVAL_TIME_SERVICE_PREDICT_SERVICE_BASE_PATH
- prediction-service base pathARRIVAL_TIME_SERVICE_DATABASE_DSN
- MongoDB connection stringARRIVAL_TIME_SERVICE_DATABASE_NAME
- MongoDB database pathARRIVAL_TIME_SERVICE_COLLECTION_NAME
- MongoDB collection name for storing routesARRIVAL_TIME_SERVICE_SEARCH_RADIUS
- a radius within searching of stored routes allowedARRIVAL_TIME_SERVICE_ROUTE_TTL_MINUTES
- a TTL of cached route
An example of
.env
is available in.env.example
-
Execute
docker-compose up
to launch a Mongo server in docker-container