go_clean

go_clean for learn clean architecture and restapi in one project.

สิ่งที่มีใน Example นี้

  • Add clean architecture for mqtt work.
  • Model / Seed
  • Controller
  • Middleware
  • Dockerfile / Build Command
  • Json web token (Authen JWT)
  • Test
  • Graceful shutdown
go mod init go_restapi

touch main.go
touch .env
mkdir Auth Config Controllers Middleware Models Routers Seeder Utility

go get github.com/dgrijalva/jwt-go v3.2.0+incompatible
go get github.com/gin-gonic/gin v1.8.1
go get github.com/golang-jwt/jwt v3.2.2+incompatible
go get github.com/joho/godotenv v1.4.0
go get github.com/pseidemann/finish v1.0.0
go get gorm.io/driver/sqlite v1.3.6
go get gorm.io/gorm v1.23.4
go mod tidy

GitHub

View Github