diff --git a/ch4-rpc/ch4-04-grpc.md b/ch4-rpc/ch4-04-grpc.md index 554bf49..74ae7de 100644 --- a/ch4-rpc/ch4-04-grpc.md +++ b/ch4-rpc/ch4-04-grpc.md @@ -4,9 +4,11 @@ GRPC是Google公司基于Protobuf开发的跨语言的开源RPC框架。GRPC基 ## 4.4.1 GRPC技术栈 -Go语言的GRPC技术栈如图所示: +Go语言的GRPC技术栈如图4-1所示: -![](../images/ch4.4-1-grpc-go-stack.png) +![](../images/ch4-1-grpc-go-stack.png) + +*图4-1 gRPC技术栈* 最底层为TCP或Unix Socket协议,在此之上是HTTP/2协议的实现,然后在HTTP/2协议之上又构建了针对Go语言的GRPC核心库。应用程序通过GRPC插件生产的Stub代码和GRPC核心库通信,也可以直接和GRPC核心库通信。 diff --git a/ch4-rpc/ch4-06-grpc-ext.md b/ch4-rpc/ch4-06-grpc-ext.md index ea22411..9924661 100644 --- a/ch4-rpc/ch4-06-grpc-ext.md +++ b/ch4-rpc/ch4-06-grpc-ext.md @@ -165,10 +165,9 @@ GRPC服务一般用于集群内部通信,如果需要对外暴露服务一般 grpc-gateway的工作原理如下图: -![](../images/ch4.6-1-grpc-gateway.png) - -*图 4.6-1 Grpc-Gateway工作流程* +![](../images/ch4-2-grpc-gateway.png) +*图 4-2 Grpc-Gateway工作流程* 通过在Protobuf文件中添加路由相关的元信息,通过自定义的代码插件生成路由相关的处理代码,最终将REST请求转给更后端的GRPC服务处理。 diff --git a/images/ch4.4-1-grpc-go-stack.png b/images/ch4-1-grpc-go-stack.png similarity index 100% rename from images/ch4.4-1-grpc-go-stack.png rename to images/ch4-1-grpc-go-stack.png diff --git a/images/ch4.6-1-grpc-gateway.png b/images/ch4-2-grpc-gateway.png similarity index 100% rename from images/ch4.6-1-grpc-gateway.png rename to images/ch4-2-grpc-gateway.png