Awesome Tools to Generate MetaEgg Framework, which is a Concise Framework For Golang.
Officially Open Source Now! - 2024/01/01 which is 元旦节 in China, and our meta-egg is 元蛋 in Chinese. 😁
https://meta-egg.jinglever.com/
A Repositry Generated by meta-egg https://github.com/Jinglever/meta-egg-layout
curl -fsSL https://github.com/Jinglever/meta-egg/raw/master/install.sh | bashpowershell -Command "& { iwr -useb https://github.com/Jinglever/meta-egg/raw/master/install.ps1 | iex }"brew tap jinglever/meta-egg
brew install meta-eggDownload the latest binary from GitHub Releases,
and put it in your $PATH.
sudo rm -f /usr/local/bin/meta-eggRemove-Item "$HOME\.meta-egg\bin\meta-egg.exe"
# 如需移除 PATH,可在"系统环境变量"中手动删除 $HOME\.meta-egg\binbrew uninstall meta-egg# Create a new project interactively
meta-egg new
# Update an existing project from manifest
meta-egg update -e ./env.yml
# Generate database SQL files
meta-egg db -e ./env.yml
# Show help for all commands
meta-egg help
# Show template placeholder help
meta-egg help template.
├── api -------------------------- 由protoc根据proto生成的api代码
├── build
│ ├── bin
│ └── package ------------------ Dockerfile之类跟打包有关的文件
├── cmd -------------------------- 工程启动的入口
├── configs ---------------------- 配置文件(如:<project-name>.yml)
├── docs ------------------------- 工程文档(如:swagger doc)
├── gen
│ ├── model -------------------- 由meta-egg生成的数据模型定义
│ └── repo --------------------- 由meta-egg生成的数据模型基础读写接口
├── go.mod
├── go.sum
├── internal
│ ├── biz ---------------------- 业务逻辑(通常是单实体的内在逻辑)
│ ├── common
│ │ ├── cerror --------------- 自定义错误
│ │ ├── constraint ----------- 业务约束(业务相关的常量或配置项等)
│ │ ├── contexts ------------- 上下文管理(如session、logger等)
│ │ └── resource ------------- 全局资源(如:db,外部服务客户端等)
│ ├── config ------------------- 配置管理
│ ├── handler
│ │ ├── grpc ----------------- GRPC服务的处理接口
│ │ └── http ----------------- HTTP服务的处理接口
│ ├── repo --------------------- 自定义的数据模型读写接口
│ │ ├── mock ----------------- 由mockgen生成的mock桩
│ │ └── option --------------- 自定义的数据结构(如FilterOption等)
│ ├── server
│ │ ├── grpc ----------------- GRPC服务监听及中间件
│ │ ├── http ----------------- HTTP服务监听及中间件
│ │ └── monitor -------------- pprof监控服务
│ └── usecase ------------------ 业务逻辑(通常是跨实体的业务块)
├── LICENSE
├── Makefile
├── _manifest -------------------- meta-egg工作区(包含原始数据模型定义)
│ ├── generated ---------------- 生成的原始文件(同于new命令的生成结果)
│ └── sql ---------------------- db命令生成的全量、增量sql,及元数据sql
├── pkg -------------------------- 组件包
├── proto ------------------------ Protobuf定义(包含自定义错误)
├── README.md
├── sql -------------------------- 工程的sql文件
└── third_party ------------------ 第三方服务包- Found a bug or want to request a feature? Open an issue
- Contributions are welcome! Please see CONTRIBUTING.md if available.
This project is licensed under the GPL-3.0 license, the full text of which can be found in the LICENSE file. You may use, copy, modify, and derive works from this project, but you are not allowed to distribute it as patented software or sell it commercially based on this project's licensing agreement. Additionally, the copyright of the code generated by this code generation tool belongs to the user. This code generation tool is not responsible for the copyright of the generated code, and the generated code is not required to adhere to the licensing agreement of this project.
本项目使用 GPL-3.0 协议,完整协议内容见 LICENSE 文件。 你可以对本项目进行使用、复制、修改、衍生,但不允许发布为专利授权的软件或以本项目授权协议为基础进行商业销售等。 由本代码生成工具生成的代码,其版权归使用者所有,本代码生成工具不对其版权负责,亦无需遵循本项目的协议。

