Giter Site home page Giter Site logo

Comments (1)

xmgtony avatar xmgtony commented on June 10, 2024

也可,这个没有标准和规范,按您自己的项目规划和喜好来即可。
我放在每个对应目录下有以下考虑:
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.