go-boilerplate
Golang service boilerplate using best practices.
Responsibility: Register (CRUD) and Login Users with JWT.
Dependencies
- Gin-Gonic
- Swaggo
- go-redis
- GORM
- MySQL
- jwt-go
Documentation (Swagger)
http://localhost:8000/auth/swagger/index.html
Composition
Pod = 1 Containers
- Container 1 = API REST
Execution / Compilation
Set Env. variables of .env-sample:
Compile with:
make run
Update Swagger Doc:
make doc
Tests
make test
Path's Organization
- cmd: binaries entrypoint
- internal: private packages
- configs: env. vars
- controller: onde fica as regras/logicas
- delivery: delivery layer -> http, grpc, messaging
- domain: models / structs
- service: external services call's
- pkg: public packages
- docs: Swagger Documentation