sponge is a powerful code generation tool, a microservices framework based on gin and gRPC.
Go to file
2023-05-17 22:45:04 +08:00
.github update docs 2023-05-17 22:45:04 +08:00
api router group 2023-04-15 18:57:06 +08:00
assets update docs 2023-05-17 22:45:04 +08:00
build build rpc test container image 2023-03-25 15:18:36 +08:00
cmd update command output message 2023-05-17 22:33:14 +08:00
configs update docs 2023-03-18 00:42:46 +08:00
deployments add log 2023-03-17 00:13:48 +08:00
docs add bulk delete interface 2023-01-14 16:24:07 +08:00
examples add examples 2023-04-24 22:32:03 +08:00
internal update command output message 2023-05-17 22:33:14 +08:00
pkg improve error code 2023-03-25 15:21:08 +08:00
scripts build rpc test container image 2023-03-25 15:18:36 +08:00
test feat: add sponge document 2022-12-13 22:35:47 +08:00
third_party adjustment code 2022-11-21 22:12:49 +08:00
.gitignore adjust command parameters 2022-11-14 23:51:09 +08:00
.golangci.yml feat: add rpc gateway and optimize code 2022-10-31 23:40:40 +08:00
codecov.yml fix: services registry and discovery 2022-10-21 21:29:20 +08:00
doc.go update release doc 2022-12-15 22:06:58 +08:00
go.mod update doc 2023-04-24 22:35:39 +08:00
go.sum update doc 2023-04-24 22:35:39 +08:00
Jenkinsfile adjustment code 2022-12-12 23:34:00 +08:00
LICENSE Initial commit 2022-09-19 23:18:08 +08:00
Makefile update docs 2023-05-17 22:45:04 +08:00
README.md update docs 2023-05-17 22:45:04 +08:00

sponge 中文文档

Go Report codecov Go Reference Go License: MIT Join the chat at https://gitter.im/zhufuyi/sponge

sponge is a powerful tool for generating web and microservice code, as well as a microservice framework based on gin and grpc encapsulation. Sponge has a wealth of code generation commands, and different functional codes can be combined to form a complete service (similar to artificially scattered sponge cells that can automatically recombine into a new sponge). Microservice code functions include logging, service registration and discovery, registration center, flow control, fuse, link tracking, metric monitoring, pprof performance analysis, statistics, cache, CICD and other functions. The code is decoupled and modularly designed, making it easy to build complete engineering code from development to deployment, making it more convenient, easy and efficient to develop with Go language.


sponge generates the code framework

The generated code is based on three approaches Yaml, SQL and Protobuf, each possessing different functional code generation, and the framework diagram of the generated code is shown in Figure 1-1.

Figure 1-1 sponge generation code framework diagram


Microservices framework

The microservice code framework created by sponge is shown in Figure 1-2, this is a typical microservice hierarchy with high performance, high scalability, and includes common service governance features.

Figure 1-2 Microservices framework diagram


Supported code types for generation

  • Generate complete web service code based on MySQL tables.
  • Generate handler code based on MySQL tables, including CRUD code.
  • Generate dao code based on MySQL tables, including CRUD code.
  • Generate model code based on MySQL tables.
  • Generate complete rpc service code based on MySQL tables.
  • Generate service code based on MySQL tables, including CRUD code.
  • Generate protobuf code based on MySQL tables.
  • Generate web service code based on protobuf.
  • Generate rpc service code based on protobuf.
  • Generate rpc gateway service code based on protobuf.
  • Generate corresponding go structure code based on yaml.
  • Generate rpc connection code according to parameters.
  • Generate cache code according to parameters.

The generated code can be combined into actual project web or microservice code, and the developer only needs to focus on writing the business logic code, online UI interface demo: https://go-sponge.com/ui


Installation


Quick start

After installing the sponge, start the UI service:

sponge run

Visit http://localhost:24631 in your browser, generate code by manipulating it on the page.


Example of sql based web project code generation.

After downloading the web project code, execute the command to start the service.

# update swagger
make docs

# build and run
make run

💡 If you don't want to use the UI interface, you can use the sponge command line to generate code, there is a wealth of examples in the command line helper information, and some of the code generation commands are more convenient than using the UI interface.


Examples of use


Documentation

sponge usage documentation


If it's help to you, give it a star .


License

See the LICENSE file for licensing information.