1 Star 2 Fork 0

AdamTyn / at-kratos

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

at-kratos

嗯,一个更适合开箱即用的 kratos-layout

  1. 环境

    Golang v1.17+
    Apollo
    数据库
    Redis
  2. 文件结构梳理

    api/... # 提供grpc服务的proto文件
    cmd/at-kratos/... # 程序入口文件
    internal/biz/...
    internal/conf/... # (解析apollo)配置的proto文件
    internal/data/...
    internal/data/dao/...
    internal/data/entity/...
    internal/pkg/cache/... # 缓存组件
    internal/pkg/database/... # 数据库组件
    internal/pkg/grpc_client/... # 调用外部的grpc客户端
    internal/pkg/http_client/... # 调用外部的http客户端
    internal/pkg/util/... # 通用组件
    internal/server/... # 注册grpc服务
    internal/service/...
    migrations/v1/... # 数据库迁移
    pkg/... # 可以暴露grpc服务的client
    tests/v1/... # 单元测试
    third_party/... # protobuf的官方依赖
    Dockerfile
    Makefile # 构建指令
    README.md
    ......
  3. 构建指令详解

    • 生成依赖注入相关文件

      make generate
    • 编译 internal/conf/conf.proto 文件

      make config
    • 编译 grpc服务.proto 文件

      make api
    • 编译调用外部的 grpc客户端.proto 文件

      make grpc-client
    • 编译调用外部的 http客户端.proto 文件

      make http-client
    • 编译打包

      make build
  4. 感谢

  5. 联系方式

MIT License Copyright (c) 2022 AdamTyn 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.

简介

嗯,一个更适合开箱即用的 kratos-layout 展开 收起
Go 等 3 种语言
MIT
取消

发行版 (2)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/adamtyn/at-kratos.git
git@gitee.com:adamtyn/at-kratos.git
adamtyn
at-kratos
at-kratos
main

搜索帮助