Comments (1)
也可,这个没有标准和规范,按您自己的项目规划和喜好来即可。
我放在每个对应目录下有以下考虑:
1、就近原则,整体性,比如service包,service的构建器和service本身应该是一个整体,应该由自己管理。不应溢出到其他地方。
2、只导出了接口,外部都是面向接口使用,对应的实现并未导出,拿到外面可能没办法使用。wire生成一个接口时要指定对应的实现和接口绑定。
上面只是我的个人的观点,你可以按照自己的想法来做,根据您的项目需要来规划。在我们的项目中,如果有多个项目,比如cmd下,有管理后台和APP的Api Server。 这两个项目入口,我们是用两个目录来分开的。每个目录下,有自己的main.go和对应的wire.go文件,虽然有一定重复,但也更灵活。
─cmd
├─admin_server
├─api_server
from apiserver-gin.
Related Issues (10)
- 求联系方式 HOT 1
- 你好,能用1.20版本不? HOT 3
- 连接多个数据库的时候怎么处理 HOT 1
- [bug-report]login时的一点小bug HOT 1
- 学习一下 HOT 2
- 代码分成思考
- 工程化可以参考下kratos最佳实践 HOT 1
- 添加多个路由或者业务逻辑的demo HOT 9
- 基于您这个项目往分布式方向修改有什么建议么? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apiserver-gin.