lile启动grpc,并使用grpcurl访问
go run main.go up
lile.Server(func(g *grpc.Server) {
test1.RegisterTest1Server(g, s)
reflection.Register(g) ++++++++++++++
})
加了上面加号那一行,注册反射。
效果如下:
~/go/bin# grpcurl -plaintext 0.0.0.0:8000 list
grpc.reflection.v1alpha.ServerReflection
test1.Test1

浙公网安备 33010602011771号