Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 1.25 KB

README.md

File metadata and controls

31 lines (27 loc) · 1.25 KB

Example Go Project

This project is an example for learning Golang design pattern and structuring folder by using OOP knowledge under the hood

Quick Start

just type this command in CLI: make run

TODO

  • connect to database
  • use Gorm's hooks (Auditable)
  • prevent Gorm to keep continuously adding conditions to it by using Session in repository struct
  • graceful shutdown
  • custom recovery middleware
  • response writer middleware
  • handle errors by both gin and internal system convention
  • returning data from modified rows
  • custom model binding and validation (must bind case)
  • custom validation
  • add example code for data validation
  • log request body
  • logging to Sentry (optional)
  • auth middleware
  • implement RequestContext
  • request timeout middleware
  • auto route mapping *(SUPER HARD)
  • refactor response util (use polymorphism)
  • ...

Related Article

https://medium.com/@anewnurse/go-series-2-create-restapi-using-gin-and-gorm-9c24f3e37324
https://medium.com/@anewnurse/go-series-3-domain-driven-design-ddd-f12707c68ea6