This is the zeroslope microservice architecture using GO. Average response times are around ~2ms for api calls that use a database, and non-database api calls ~28μs. Memory footprint seems to be around 9.9mb of ram allocated to the go process when running the most expensive call.
Recently updated to reflect changes in GO 1.13.X.
Here is a list of the technologies used in this project:
- We use MODULES for package management.
- We use SWAG for swagger generation.
- We use DLV for Debugging in VSCODE
- We use GIN for http routing.
- We use VEGETA for load testing.
- We use GORM for our ORM layer.
- We use PG for postgres database access.
Here is an overall layout of what endpoints come with this architecture:
| Method | Route | Description |
|---|---|---|
| N/A | /swagger/index.html | Swagger UI |
| GET | /health/ | Health check. |
| POST | /auth/login | Creates a JWT token for access. |
| GET | /sample | Gets a list of records. |
| GET | /sample/:id | Gets a record by id. |
| POST | /sample/ | Creates a record. |
| PUT | /sample/ | Updates a record. |
| DELETE | /sample/:id | Deletes a record. |
Currently I write my golang in VSCODE and use the following commands:
go mod vendorcd src; swag init; cd ..go run main.goVisit: http://localhost:8080/swagger/index.html
docker run --name pgdb -p 5432:5432 -e POSTGRES_PASSWORD=P4ssw0rd! -e POSTGRES_DB=zeroslope -d postgresTBD