From 2a0875aa7a54688d3712836b12955e556ae5a82d Mon Sep 17 00:00:00 2001 From: chai2010 Date: Thu, 23 Aug 2018 17:54:52 +0800 Subject: [PATCH 1/4] =?UTF-8?q?ch4.8:=20=E5=A2=9E=E5=8A=A0grpcurl=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch4-rpc/ch4-08-grpcurl.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ch4-rpc/ch4-08-grpcurl.md b/ch4-rpc/ch4-08-grpcurl.md index fa90f74..1e6c999 100644 --- a/ch4-rpc/ch4-08-grpcurl.md +++ b/ch4-rpc/ch4-08-grpcurl.md @@ -29,6 +29,13 @@ func main() { grpcurl中最常使用的是list命令,用于获取服务或服务方法的列表。比如`grpcurl localhost:1234 list`命令将获取本地1234端口上的grpc服务的列表。在使用grpcurl时,需要通过`-cert`和`-key`参数设置公钥和私钥文件,链接启用了tls协议的服务。对于没有没用tls协议的grpc服务,通过`-plaintext`参数忽略tls证书的验证过程。 +首先安装grpcurl工具: + +``` +$ go get github.com/fullstorydev/grpcurl +$ go install github.com/fullstorydev/grpcurl/cmd/grpcurl +``` + 如果没有配置好公钥和私钥文件,也没有忽略证书的验证过程,那么将会遇到类似以下的错误: ```shell From a092e2a85923e7af215761bd028b4eded14b3a41 Mon Sep 17 00:00:00 2001 From: chai2010 Date: Thu, 23 Aug 2018 17:55:06 +0800 Subject: [PATCH 2/4] =?UTF-8?q?ch3.4:=20=E4=BF=AE=E5=A4=8Dswap=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch3-asm/ch3-04-func.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ch3-asm/ch3-04-func.md b/ch3-asm/ch3-04-func.md index d1b1cb9..e247757 100644 --- a/ch3-asm/ch3-04-func.md +++ b/ch3-asm/ch3-04-func.md @@ -90,10 +90,10 @@ TEXT ·Swap(SB), $0-32 ``` TEXT ·Swap(SB), $0 - MOVEQ a+0(FP), AX // a - MOVEQ b+8(FP), BX // b - MOVEQ ret0+16(FP), CX // ret0 - MOVEQ ret1+24(FP), DX // ret1 + MOVQ a+0(FP), AX // a = AX + MOVQ b+8(FP), BX // b = BX + MOVQ BX, ret0+16(FP) // ret0 = BX + MOVQ AX, ret1+24(FP) // ret1 = AX RET ``` From 8bf187e835ea0ad73cbe3dcf83a1c6d664dddb4a Mon Sep 17 00:00:00 2001 From: chai2010 Date: Thu, 23 Aug 2018 18:17:22 +0800 Subject: [PATCH 3/4] =?UTF-8?q?ch4.8:=20=E5=A2=9E=E5=8A=A0unix=20socket?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch4-rpc/ch4-08-grpcurl.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ch4-rpc/ch4-08-grpcurl.md b/ch4-rpc/ch4-08-grpcurl.md index 1e6c999..508430c 100644 --- a/ch4-rpc/ch4-08-grpcurl.md +++ b/ch4-rpc/ch4-08-grpcurl.md @@ -27,15 +27,15 @@ func main() { ## 4.8.2 查看服务列表 -grpcurl中最常使用的是list命令,用于获取服务或服务方法的列表。比如`grpcurl localhost:1234 list`命令将获取本地1234端口上的grpc服务的列表。在使用grpcurl时,需要通过`-cert`和`-key`参数设置公钥和私钥文件,链接启用了tls协议的服务。对于没有没用tls协议的grpc服务,通过`-plaintext`参数忽略tls证书的验证过程。 - -首先安装grpcurl工具: +grpcurl是Go语言开源社区开发的工具,需要手工安装: ``` $ go get github.com/fullstorydev/grpcurl $ go install github.com/fullstorydev/grpcurl/cmd/grpcurl ``` +grpcurl中最常使用的是list命令,用于获取服务或服务方法的列表。比如`grpcurl localhost:1234 list`命令将获取本地1234端口上的grpc服务的列表。在使用grpcurl时,需要通过`-cert`和`-key`参数设置公钥和私钥文件,链接启用了tls协议的服务。对于没有没用tls协议的grpc服务,通过`-plaintext`参数忽略tls证书的验证过程。如果是Unix Socket协议,则需要指定`-unix`参数。 + 如果没有配置好公钥和私钥文件,也没有忽略证书的验证过程,那么将会遇到类似以下的错误: ```shell From d12755b32a4e16f2bc8967ff7657952823372277 Mon Sep 17 00:00:00 2001 From: chai2010 Date: Fri, 24 Aug 2018 12:39:53 +0800 Subject: [PATCH 4/4] =?UTF-8?q?ch3.4:=20=E6=B3=A8=E9=87=8A=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch3-asm/ch3-04-func.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ch3-asm/ch3-04-func.md b/ch3-asm/ch3-04-func.md index e247757..8e45c7e 100644 --- a/ch3-asm/ch3-04-func.md +++ b/ch3-asm/ch3-04-func.md @@ -90,8 +90,8 @@ TEXT ·Swap(SB), $0-32 ``` TEXT ·Swap(SB), $0 - MOVQ a+0(FP), AX // a = AX - MOVQ b+8(FP), BX // b = BX + MOVQ a+0(FP), AX // AX = a + MOVQ b+8(FP), BX // BX = b MOVQ BX, ret0+16(FP) // ret0 = BX MOVQ AX, ret1+24(FP) // ret1 = AX RET