Microservices Demo for Workshop
This repository has the purpose of acting like a guide through our workshop about Microservices in Go.
This repository is split in many branches, each branch represents a final part of each iteration.
Counters API
The application we will create during the workshop is a microservices, part of a bigger project about counters. Main goal of this workshop is to offer a demostration of how you can create a simple but well organized microservice using Go.
It is built using Gorilla mux, a powerful library to create APIs.
The final result will be a fully functional microservice, that will use mongoDB
for storing the data, and Kafka for sharing events between our microservices and the others.
Libraries
In this application we're using, of course, the standard library, but also some third party libraries as:
Using our microservices
Run docker (only necessary for solution two onwards)
First of all you need a Lenses key: it's totally free, you only need to register on: https://lenses.io/downloads/lenses/
After doing it you'll receive a message with a link, that will generate your key.
Once you have the key, you just need to replace it on the docker-compose.yml, {LENSE_ID}.
$ docker-compose up -d
Build
$ make build
Launch
$ make run
For testing the application we're using a tool that is using go test behind the scenes, but also puts colors on it.
For that you need to install:
GO111MODULE=off go get -u github.com/rakyll/gotest
And then you can run:
make test
License
MIT License, see LICENSE