golang-clean-template

所属分类:PostgreSQL
开发工具:GO
文件大小:22KB
下载次数:0
上传日期:2023-04-11 05:20:53
上 传 者sh-1993
说明:  使用golang编程语言并在gin-gorm的帮助下创建一个干净的模板架构
(Create a clean template architecture with the golang programming language and with the help of gin gorm)

文件列表:
.env.example (94, 2023-05-31)
LICENSE (1077, 2023-05-31)
config (0, 2023-05-31)
config\database.go (1196, 2023-05-31)
controller (0, 2023-05-31)
controller\user.go (5078, 2023-05-31)
database.sql (493, 2023-05-31)
dto (0, 2023-05-31)
dto\user.go (1199, 2023-05-31)
entities (0, 2023-05-31)
entities\common.go (385, 2023-05-31)
entities\user.go (711, 2023-05-31)
go.mod (1831, 2023-05-31)
go.sum (13028, 2023-05-31)
helpers (0, 2023-05-31)
helpers\password.go (431, 2023-05-31)
main.go (1047, 2023-05-31)
middleware (0, 2023-05-31)
middleware\authentication.go (1555, 2023-05-31)
middleware\cors.go (611, 2023-05-31)
railway.yml (58, 2023-05-31)
repository (0, 2023-05-31)
repository\user.go (2056, 2023-05-31)
routes (0, 2023-05-31)
routes\routes.go (797, 2023-05-31)
services (0, 2023-05-31)
services\jwt.go (1821, 2023-05-31)
services\user.go (2880, 2023-05-31)
utils (0, 2023-05-31)
utils\bcrypt.go (13, 2023-05-31)
utils\response.go (539, 2023-05-31)

# Golang Clean Architecture ## Introduction ‘ > Clean Architecture is an approach to organizing code in an application that focuses on separating responsibilities and dependencies between components. In the context of Golang, Clean Architecture refers to the application of Clean Architecture principles in developing applications using the Go programming language. Clean Architecture proposes a structured application design with several layers that have clear and isolated responsibilities. Each layer has a specific role and boundaries. Here are some common layers in Golang Clean Architecture ## Layers ” - **Domain Layer:** This layer contains the core business definitions of the application. It is the innermost layer and does not depend on any other layers. It includes entities, business rules, and repository interfaces that will be implemented in the infrastructure layer. - **Use Case Layer:** This layer holds the business logic specific to use cases in the application. Use cases provide operations and interactions between entities in the domain layer. Use cases do not depend on implementation details in the infrastructure layer. - **Delivery Layer:** This layer is responsible for receiving and delivering data to and from the application. It typically consists of APIs, controllers, and presenters. This layer acts as the interface to interact with the outside world and can take input from users or deliver output to users. - **Repository Layer:** This layer is responsible for implementing the repository interfaces defined in the domain layer. Repositories are used to access and store data from the storage (database, cache, APIs, etc.). This layer serves as a bridge between the domain layer and the infrastructure layer. - **Infrastructure Layer:** This layer contains the technical details and implementation of the technologies used in the application, such as databases, networking, data storage, and external APIs. This layer depends on other layers and is used to implement the technical components required by the application. ## How To Use?

近期下载者

相关文件


收藏者