Skip to content

3ackdoor/demo-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published