sponge is a powerful code generation tool, a microservices framework based on gin and gRPC.
Go to file
2023-09-24 16:56:36 +08:00
.github update docs 2023-09-17 10:54:42 +08:00
api add arbitrary condition query api 2023-09-17 12:13:38 +08:00
assets update docs 2023-09-17 10:54:42 +08:00
cmd add arbitrary condition query api 2023-09-17 12:13:38 +08:00
configs support for multi-selecting mysql tables 2023-08-28 17:06:37 +08:00
deployments update deployment 2023-09-02 22:18:32 +08:00
docs add arbitrary condition query api 2023-09-17 12:13:38 +08:00
examples update README 2023-07-27 00:57:55 +08:00
internal add arbitrary condition query api 2023-09-17 12:13:38 +08:00
pkg add arbitrary condition query api 2023-09-17 12:13:38 +08:00
scripts supports for a given proto file 2023-09-24 16:56:36 +08:00
test update deployment 2023-09-02 22:18:32 +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 change revive rule 2023-08-06 18:46:36 +08:00
codecov.yml fix: services registry and discovery 2022-10-21 21:29:20 +08:00
doc.go change names 2023-09-03 00:33:04 +08:00
go.mod fix: Mac M1 install 2023-09-09 18:53:04 +08:00
go.sum fix: Mac M1 install 2023-09-09 18:53:04 +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 supports for a given proto file 2023-09-24 16:56:36 +08:00
README.md update docs 2023-09-17 10:54:42 +08:00

sponge 中文

Go Report codecov Go Reference Go License: MIT

sponge is a powerful golang productivity tool that integrates automatic code generation, web and microservices frameworks, basic development framework. sponge has a wealth of code generation commands to generate different functionality of the code can be combined into a complete service (similar to artificially scattered sponge cells that can automatically recombine into a new sponge). Code decoupling modular design , it is easy to build a complete project from development to deployment, so that you develop web or microservices project easily, golang can also be "low-code development".


sponge generates the code framework

sponge is mainly based on SQL and Protobuf two ways to generate code, each way has to generate code for different functions.

Generate code framework:


Generate code framework corresponding UI interface:


Services framework

sponge generated microservice code framework is shown in the figure below, which is a typical microservice hierarchical structure, with high performance, high scalability, contains commonly used service governance features, you can easily replace or add their own service governance features.


Egg model for complete service code

The sponge separates the two major parts of code during the process of generating web service code. It isolates the business logic from the non-business logic. For example, consider the entire web service code as an egg. The eggshell represents the web service framework code, while both the albumen and yolk represent the business logic code. The yolk is the core of the business logic (manually written code). It includes defining MySQL tables, defining API interfaces, and writing specific logic code.On the other hand, the albumen acts as a bridge connecting the core business logic code to the web framework code (automatically generated, no manual writing needed). This includes the registration of route code generated from proto files, handler method function code, parameter validation code, error codes, Swagger documentation, and more.

Egg model profiling diagram for ⓷Web services created based on protobuf:

This is the egg model for web service code, and there are egg models for microservice (gRPC) code, and rpc gateway service code described in sponge documentation.


Quick start

Installation sponge:

sponge can be installed on Windows, macOS, and Linux environments. Click here to view Installation Instructions.

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.


Documentation

sponge documentation


Examples of use

Simple examples (excluding business logic code)

Full project examples (including business logic code)


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


License

See the LICENSE file for licensing information.


How to contribute

You are more than welcome to join us, raise an Issue or Pull Request.

Pull Request instructions.

  1. Fork the code
  2. Create your own branch: git checkout -b feat/xxxx
  3. Commit your changes: git commit -am 'feat: add xxxxx'
  4. Push your branch: git push origin feat/xxxx
  5. Commit your pull request