微服務版
├── LICENSE.md
├── Makefile //在任何一個專案中都會存在一些需要運行的腳本,這些腳本檔案應該被放到 /scripts 目錄中并由 Makefile 觸發
├── README.md //描述專案的檔案
├── api //對外提供的各種不同型別的API介面定義檔案
├── oceanbook.pb.go
└── oceanbook.proto
├── assets
├── build //編譯后的檔案
├── cmd //cmd 目錄中存盤的都是當前專案中的可執行檔案
├── configs //組態檔
├── deployments
├── docs //存放檔案
├── examples //存放測驗用例
├── githooks
├── init //存放中間件的初始化檔案
├── internal //私有代碼推薦放到 /internal 目錄中,真正的專案代碼應該寫在 /internal/app 里,同時這些內部應用依賴的代碼庫應該在 /internal/pkg 子目錄和 /pkg 中
└── pkg
└── app
└── user //里面含有model, repository,service,controller檔案,不按mvc進行分層
└── order
├── pkg //這個目錄中存放的就是專案中可以被外部應用使用的代碼庫,其他的專案可以直接通過 import 引入這里的代碼
├── scripts //腳本檔案存放腳本檔案
├── test //存放測驗檔案
gin版 (待總結)
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/423716.html
標籤:Go
