Skip to content
ServiceMesh下的微服务架构实践
Java
Branch: master
Clone or download
Latest commit 7e3ab8b Aug 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
deploy istio ingress Aug 10, 2019
doc
example-java add java示例 Aug 15, 2019
examples istio tracing header完善 Aug 10, 2019
proto 添加k8s注册中心部署示例 Aug 8, 2019
third_party/googleapis init Feb 22, 2019
.gitignore init Feb 22, 2019
LICENSE Initial commit Dec 9, 2018
README.md 重写example Aug 1, 2019
go.mod istio环境tracing传递bug,需要将trace相关header做转发 Aug 9, 2019
go.sum istio环境tracing传递bug,需要将trace相关header做转发 Aug 9, 2019

README.md

Micro Mesh

micro-mesh

环境

  • OSX
  • GKE 1.12.5-gke.10
  • Go 1.11.1
  • Istio 1.1.0
  • protoc libprotoc 3.6.1

目录

TODO

  • hb-go/grpc-gateway
    • gen-grpc-gateway扩展,支持gRPC服务本地调用,在service中启动http server
    • gen-istio-gateway通过grpc-gateway API自动生成istio gateway的.yaml配置
    • swagger-codegen
  • Istio部署
    • k8s.yaml脚本
    • JWTGateway认证
    • RBAC服务间访问控制
    • 自定义auth-adapter
  • 服务
    • gRPC ClientConn对象池
    • 并发
      • 并发控制WaitCancel
      • 超时控制Timeout
    • 流处理
    • 同步&异步调用
    • 配置中心
    • CI/CD

Protoc

安装

go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go
go get -u github.com/hb-go/grpc-contrib/protoc-gen-hb-grpc

使用fork grpc-gateway的protoc-gen-grpc-gateway

cd $GOPATH/src/github.com/grpc-ecosystem
git clone github.com/hb-go/grpc-gateway
make bin/protoc-gen-grpc-gateway
mv bin/protoc-gen-grpc-gateway $GOPATH/bin/protoc-gen-grpc-gateway

代码生成

# go+grpc
# grpc-gateway
# swagger
# hb-grpc
protoc -I./ \
--go_out=plugins=grpc:. \
--grpc-gateway_out=logtostderr=true,grpc_api_configuration=proto/gateway.yaml:. \
--swagger_out=logtostderr=true,grpc_api_configuration=proto/gateway.yaml:. \
--hb-grpc_out=plugins=registry+desc:. \
proto/*.proto
You can’t perform that action at this time.