5 Star 17 Fork 4

瓦莱里奥·赵四 / mt-zero

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

#mt-zero微服务工程框架

##项目环境

go1.15
go-zero
gomod
gorm
goimoprts
etcd
mysql
redis
GNU Make 4.3
goreman 0.2.1

##项目目录

src 项目
    gateway  网关层
    util    依赖包
bin 编译后执行文件,gitignore
go.mod      gomod文件
Makefile    make命令文件
Procfile    goreman命令文件
run.sh      本地执行项目文件
docker      容器化镜像文件

##初始化项目

请执行根目录 init.sh 脚本

##response模板调整

go-zero的响应模板调整
goctl template init
cp src/util/tpl/handler.tpl ~/.goctl/api/handler.tpl

##make命令

make gateway 解析api文件并编译gateway
make {project} 解析proto文件并编译项目,例如meeting
make newrpc PROJECT={project} 创建一个新微服务并生成proto,例如app
make rpc PROJECT={project} 解析指定服务微服务proto,例如app
make build PROJECT={project} 编译指定服务微服务,例如app
make model PROJECT={project} 预生成mysql表映射代码,前提是在微服务目录下创建sql/{mysql}.sql文件

##goreman命令

多项目启动软件
goreman start 启动Procfile中的服务
goreman run status 启动进程信息

##gateway编写规则

所有response如果有err,必须使用response.ErrXXXX.WithMessage("error msg")
用来规范对外输出的code和错误信息
MIT License Copyright (c) 2021 瓦莱里奥·赵四 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

MT团队基于go-zero更改的适应于自身业务的golang框架 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/x-four/mt-zero.git
git@gitee.com:x-four/mt-zero.git
x-four
mt-zero
mt-zero
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891