Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spirosoik/go-driver-microservices
Microservices example, written in Go for driver's availability in a ride sharing business
https://github.com/spirosoik/go-driver-microservices
docker gateway-microservice golang microservices microservices-architecture nsq
Last synced: about 5 hours ago
JSON representation
Microservices example, written in Go for driver's availability in a ride sharing business
- Host: GitHub
- URL: https://github.com/spirosoik/go-driver-microservices
- Owner: spirosoik
- License: apache-2.0
- Created: 2018-06-21T06:00:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-01T08:01:25.000Z (over 6 years ago)
- Last Synced: 2024-06-20T08:14:46.720Z (5 months ago)
- Topics: docker, gateway-microservice, golang, microservices, microservices-architecture, nsq
- Language: Go
- Size: 49.8 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Go Report Card](https://goreportcard.com/badge/github.com/spirosoik/go-driver-microservices)](https://goreportcard.com/report/github.com/spirosoik/go-driver-microservices)
## Overview
![Architecture](architecture-overview.png)
- `gateway` just forwards or transforms the requests. Exposes the endpoints and decides the transport method based on `./gateway/config.yml`
- `driver location service` receives all the location data by the driver through NSQ.
- `zombie driver service` checks if the driver has been moved from his location and it's a zombie driver or not through HTTP.### Prerequisites
Your machine should have installed the following tools in order to run the project:
- `Go` and you can find the instructions [here](https://golang.org/doc/install).
- `Docker` client and you can find instructions [here](https://docs.docker.com/install/)
- `docker-compose` cli tool. You can find instructions [here](https://docs.docker.com/compose/install/)### Usage
All the setup is based on Docker containers. Each service has its own Dockerfile and it builds each go microservice explicitly. Each `Dockerfile` is declared on the root path of each service. More specifically here
- [Gateway](./gateway/Dockerfile)
- [Driver Location](./driver-location/Dockerfile)
- [Zombie Driver](./zombie-driver/Dockerfile)So there is no need by your side to set the project in a `$GOPATH` you can use it immediately.
The ports which are available for usage of each microservice are exposed and are declared in [docker-compose.yml](./docker-compose.yml). In this case the only exposed port is for *gateway* service which is the *8080*.
The commands which you should use in order to run all the services are the followings:
```
make
docker-compose up -d
```