第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在 CloudRun 上反映 gRPC 服務(wù)的列表?

如何在 CloudRun 上反映 gRPC 服務(wù)的列表?

Go
慕尼黑8549860 2022-08-15 15:46:16
按照此示例執(zhí)行以下操作:gRPC in Google Cloud Runhttps://github.com/grpc-ecosystem/grpc-cloud-run-example/blob/master/golang/README.md我已經(jīng)部署了一個gRPC服務(wù),并在CloudRun上進(jìn)行了反思。使用 grpcurl 進(jìn)行測試:https://github.com/fullstorydev/grpcurlgrpcurl \-proto protos/calculator.proto \-d '{"first_operand": 2.0, "second_operand": 3.0, "operation": "ADD"}' \${ENDPOINT}:443 \Calculator.CalculateGRPC 服務(wù)器反射協(xié)議 https://github.com/grpc/grpc/blob/master/doc/server-reflection.md現(xiàn)在我想按照這些說明使用反射。--- a/examples/helloworld/greeter_server/main.go+++ b/examples/helloworld/greeter_server/main.go@@ -40,6 +40,7 @@ import (        "google.golang.org/grpc"        pb "google.golang.org/grpc/examples/helloworld/helloworld"+       "google.golang.org/grpc/reflection" ) const (@@ -61,6 +62,8 @@ func main() {        }        s := grpc.NewServer()        pb.RegisterGreeterService(s, &pb.GreeterService{SayHello: sayHello})+       // Register reflection service on gRPC server.+       reflection.Register(s)        if err := s.Serve(lis); err != nil {                log.Fatalf("failed to serve: %v", err)        }https://github.com/grpc/grpc-go/blob/master/Documentation/server-reflection-tutorial.md#enable-server-reflection您嘗試了什么:本地測試。請注意:grpcurl -plaintext 表示不是 TLS。省略 -純文本表示 TLS。什么有效:############################# local testing############################request list:grpcurl -plaintext localhost:8080 listresult:Calculatorgrpc.reflection.v1alpha.ServerReflectionrequest ADD function:grpcurl -plaintext \    -d '{"first_operand": 2.0, "second_operand": 3.0, "operation": "ADD"}' \    localhost:8080 \    Calculator.Calculateresult:{  "result": 5}############################您嘗試的內(nèi)容:GCP CloudRun 測試。請注意:grpcurl -plaintext 表示不是 TLS。省略 -純文本表示 TLS。什么有效:request:grpcurl \    -proto protos/calculator.proto \    -d '{"first_operand": 2.0, "second_operand": 3.0, "operation": "ADD"}' \    ${ENDPOINT}:443 \    Calculator.Calculateresult:{  "result": 5}什么不起作用:我想使用反射,所以省略:-proto protos/calculator.proto \我想使用TLS,所以省略了:-plaintext
查看完整描述

1 回答

?
哆啦的時光機(jī)

TA貢獻(xiàn)1779條經(jīng)驗(yàn) 獲得超6個贊

gRPC 反射需要雙向流式處理,因此請確保在部署時選中啟用 HTTP/2 選項(xiàng) (--use-http2)。這將實(shí)現(xiàn)雙迪流。

此外,請確保使用 :443 端口,并在需要時通過添加身份驗(yàn)證元數(shù)據(jù)向服務(wù)器進(jìn)行身份驗(yàn)證(請參閱服務(wù)到服務(wù)身份驗(yàn)證文檔)。


查看完整回答
反對 回復(fù) 2022-08-15
  • 1 回答
  • 0 關(guān)注
  • 100 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號