You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Makefile
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -169,7 +169,7 @@ image-build-rpc-test:
169
169
170
170
171
171
.PHONY: patch
172
-
# patch some dependent code, such as types.proto, mysql initialization code. e.g. make patch TYPE=types-pb , make patch TYPE=init-your_db_driver, replace "your_db_driver" with mysql, postgresql, tidb, sqlite
172
+
# patch some dependent code, such as types.proto, mysql initialization code. e.g. make patch TYPE=types-pb , make patch TYPE=init-your_db_driver, replace "your_db_driver" with mysql, mongodb, postgresql, tidb, sqlite
Copy file name to clipboardExpand all lines: README.md
+9-12Lines changed: 9 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -19,15 +19,15 @@
19
19
20
20
<br>
21
21
22
-
If you are developing a RESTful web service or microservice with a simple CRUD API interface, you don't need to write a single line of Go code to compile and deploy to servers, dockers, k8s, and the complete service code is generated by sponge.
22
+
If you are develop RESTful web service or microservice with a simple CRUD API interface, you don't need to write any Go code can be compiled and deployed to the linux server, docker, k8s, just need to connect to the database (mysql、mongodb、postgresql、tidb、sqlite) to generate a complete service code.
23
23
24
-
If you develop a generic RESTful web service or microservice, you need to manually write code in addition to defining the data table, defining the api interface in the proto file, and filling in the specific business logic code in the generated template file. Other Go codes are generated by sponge.
24
+
If you develop generic web or microservices, just focus on the three core parts of `define database tables`, `define api interfaces in proto files`, `fill in business logic code in the generated template files`, and the rest of the go code is automatically generated by sponge.
25
25
26
26
<br>
27
27
28
28
### Sponge Generates the Code Framework
29
29
30
-
sponge is mainly based on `SQL` and `Protobuf` two ways to generate code, each way has to generate code for different functions. `SQL` supports databases **mysql**, **postgresql**, **tidb**, **sqlite**.
30
+
sponge is mainly based on `SQL` and `Protobuf` two ways to generate code, each way has to generate code for different functions. `SQL` supports databases **mysql**, **mongodb**, **postgresql**, **tidb**, **sqlite**.
31
31
32
32
#### Generate Code Framework
33
33
@@ -47,9 +47,9 @@ sponge is mainly based on `SQL` and `Protobuf` two ways to generate code, each w
47
47
48
48
#### Generate Code for Egg Model
49
49
50
-
The sponge code generation process strips away the business logic and non-business logic of the two major parts of the code, sponge generated a complete web service back-end code as a complete egg:
50
+
The sponge code generation process strips away the business logic and non-business logic of the two major parts of the code. Sponge's code generation function as a hen, the generated service code is the egg, take the generated web service backend code as an example:
51
51
52
-
-`Eggshell`represents the web service framework code, `yolk` and `Albumen` both represent the business logic code.
52
+
-`Eggshell`is web service framework code (automatically generated without manual writing).
53
53
-`Yolk` is the core of business logic. For example, defining mysql tables, defining api interfaces, and writing specific logic codes all belong to yolk (code that needs to be written manually).
54
54
-`Albumen` is a bridge connecting the core code of business logic and the web framework code. For example, the registration route code, handler code, parameter verification code, error code, and swagger document generated according to the proto file belong to the albumen (code that automatically generated without manual writing).
55
55
@@ -75,9 +75,6 @@ Sponge is essentially a microservice framework that includes code generation cap
75
75
76
76
### Key Features
77
77
78
-
- User-friendly UI for code generation commands.
79
-
- Not only generate code template examples, but also automatically merge the new template code to achieve api interface "low-code development".
80
-
- Modular and decoupled code design with rich functional components readily available, you can also easily use their own components.
81
78
- Web framework [gin](https://github.com/gin-gonic/gin)
@@ -115,23 +112,23 @@ The project code directory structure created by sponge follows the [project-layo
115
112
│ ├── initial # Program initialization, consisting of three files: initApp initializes configurations, registerServers registers services (HTTP or grpc), and registerClose registers resource cleanup.
116
113
│ └── main.go # Program entry file
117
114
├── configs # Directory for configuration files
118
-
├── deployments # Directory for deployment scripts, supporting binary, Docker, and Kubernetes deployments.
115
+
├── deployments # Directory for deployment scripts, supporting binary, Docker and Kubernetes deployments.
119
116
├─ docs # Directory for API interface Swagger documentation.
120
117
├── internal # Directory for code of private applications and libraries.
121
118
│ ├── cache # Cache directory wrapped around business logic.
122
119
│ ├── config # Directory for Go structure configuration files.
123
-
│ ├── dao # Data access directory, e.g., interfaces for CRUD operations on MySQL tables.
120
+
│ ├── dao # Data access directory.
124
121
│ ├── ecode # Directory for system error codes and custom business error codes.
125
122
│ ├── handler # Directory for implementing HTTP business functionality (specific to web services).
126
123
│ ├── model # Database model directory.
127
124
│ ├── routers # HTTP routing directory.
128
125
│ ├── rpcclient # Directory for client-side code that connects to grpc services.
129
126
│ ├── server # Directory for creating services, including HTTP and grpc.
130
-
│ ├── service # Directory for implementing grpc business functionality (specific to microservices).
127
+
│ ├── service # Directory for implementing grpc business functionality (specific to grpc services).
131
128
│ └── types # Directory for defining request and response parameter structures for HTTP.
132
129
├── pkg # Directory for shared libraries.
133
130
├── scripts # Directory for scripts, including compilation, execution, code generation, and deployment scripts.
134
-
├── test# Directory for scripts required for testing services, such as scripts to start dependencies (e.g., MySQL, Redis) and test data (SQL).
131
+
├── test# Directory for scripts required for testing servicesand test SQL.
135
132
└── third_party # Directory for external helper programs, forked code, and other third-party tools.
0 commit comments