GO-Grpc微服务开发一 概览

栏目: 后端 · 发布时间: 7年前

内容简介:源码:

概览

项目地址

git@github.com:juelite/micro-srv.git

主要依赖/工具

  • github.com/Unknwon/goconfig 配置文件解析
  • github.com/golang/protobuf/proto 数据传输格式
  • Protocol Buffers 编译器

目录结构

├── README.md               
├── common                  公共包
│   ├── common.go           实现一些基础方法,如配置文件读取,获取 redis 句柄等
│   └── register.go         服务注册封装
├── conf                    配置文件目录
│   ├── config.conf         项目配置文件,如consul地址等
│   ├── db.conf             数据库配置文件
│   └── env.conf            运行环境
├── constant                常量包
│   └── status_code.go      定义所有返回码
├── consul                  consul api封装
│   ├── register.go         
│   ├── resolver.go
│   └── watcher.go
└── service                 服务模块集合
    ├── cache               缓存服务
    │   ├── README.md
    │   ├── logics          业务逻辑包
    │   │   └── redis.go    具体业务
    │   ├── main.go         服务入口
    │   ├── proto           proto文件
    │   │   ├── cache.pb.go 执行protoc.sh生成的文件
    │   │   ├── cache.proto 定义服务
    │   │   └── protoc.sh   编译proto文件
    │   └── test            测试包
    │       └── client.go   用于测试本服务的客户端
    ·
    ·
    ·

源码: go-grpc-getway


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Starfish and the Spider

The Starfish and the Spider

Ori Brafman、Rod A. Beckstrom / Portfolio Hardcover / 2006-10-05 / USD 24.95

Understanding the amazing force that links some of today's most successful companies If you cut off a spider's leg, it's crippled; if you cut off its head, it dies. But if you cut off a st......一起来看看 《The Starfish and the Spider》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具