几种gRPC调试工具

参照 golang开发一个简单的grpc[1]

完整代码:github.com/cuishuang/grpcdemo[2], 此处仅需要使用gRPC Server,不需要Client部分


切到 helloservice目录执行 go run main/main.go

alt



grpcui


fullstorydev/grpcui[3]

go install github.com/fullstorydev/grpcui/cmd/grpcui@latest


grpcui -plaintext 127.0.0.1:1234

alt

参考调试工具_微服务实战之 Go gRPC 调试工具[4],在源码中加一行reflection.Register(s)

alt

重新启动Server

alt

alt
alt



grpcurl


grpcui底层其实就是grpcurl

go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latestbrew install grpcurl 或使用Docker

# Download image

docker pull fullstorydev/grpcurl:latest

# Run the tool

docker run fullstorydev/grpcurl api.grpc.me:443 list

grpcurl -plaintext localhost:端口号 list

alt

不如grpcui直观




Postman


alt
alt

三種好用的 gRPC 測試工具[5]


另外类似的工具还有 Evans,BloomRPC (超实用的 gRPC 客户端调试工具[6])

参考资料

[1]

golang开发一个简单的grpc: https://waterflow.link/articles/1665674508275

[2]

github.com/cuishuang/grpcdemo: https://github.com/cuishuang/grpcdemo

[3]

fullstorydev/grpcui: https://github.com/fullstorydev/grpcui

[4]

调试工具_微服务实战之 Go gRPC 调试工具: https://blog.csdn.net/weixin_39621178/article/details/112699562

[5]

三種好用的 gRPC 測試工具: https://learnku.com/articles/71123

[6]

超实用的 gRPC 客户端调试工具: https://zhuanlan.zhihu.com/p/424825387

本文由 mdnice 多平台发布

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值