gin-zero
๐คทโ What is gin-zero?
English | ็ฎไฝไธญๆ
Gin-zero is a gin-based golang application scaffolding that supports one-click generation of HTTP, GRPC, Websocket
applications, and can also be used to build microservice applications.
It integrates many excellent open source packages internally, and also provides some modular microservices governance
packages.
Gin-zero has a code generation tool called ginctl
.
Are you still worried about writing the mapping structure of the database? Are you still struggling to write database field-restricted validation request structs? Get started with ginctl
, which helps you write database mapping structures and validation structures through database annotations.
Ability statement
- One command generates the entire http,grpc,websocket service
- A command generates a Restful API, or a custom interface
- A command generates middleware or global middleware
- A command generates the service configuration file
- One command to generate the service deployment folder
Support package
Environment
Quick start
- An example of http application: demo
- Install
git clone https://github.com/gin-ctl/zero
cd zero
go install github.com/gin-ctl/ginctl@latest
ginctl -h
# example
ginctl apply --app admin --module http # A command generates the admin application of the http request
# Next modify your etc/env.yaml file
ginctl api -a admin -m http -l user -o ping -d test # Generate an http request interface 'ping' for the user module in the admin application
# Then go to the route directory and fill in your request method for the ping interface
- Directory description
- app: application directory contains http, grpc, and websocket
- Application directory
app/http/demo
โโโ demo.go # main.go
โโโ deploy # deployment document
โย ย โโโ DockerFile
โย ย โโโ Makefile
โย ย โโโ certificate.yaml # Subscribe to ssl encrypted files for domain names for free
โย ย โโโ gateway.yaml # Kubernetes gateway configuration file
โย ย โโโ k8s.yaml # Kubernetes deployment file
โโโ etc
โย ย โโโ env.yaml # Modify your application configuration
โโโ logic
โย ย โโโ demo # Service code
โย ย โย ย โโโ logic.go # http request controller
โย ย โย ย โโโ types.go # http request checksum request structure
โย ย โโโ logic.go
โโโ middleware # middleware
โย ย โโโ auth.go
โโโ route # Routing file
โย ย โโโ route.go
โโโ storage # Log file
โโโ logs-2024-07-06.log
Code of Conduct
In order to ensure that the gin-zero community is welcoming to all, please review and abide by
the Code of Conduct.
Security Vulnerabilities
If you discover a security vulnerability within gin-zero, please send an e-mail to Joey via golang2024@163.com. All security vulnerabilities will be promptly addressed.
License
The gin-zero framework is open-sourced software licensed under the MIT license.