-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please generate these files with google.golang.org/grpc/cmd/protoc-gen-go-grpc #1040
Comments
Hey I am not sure if we are likely to do this anytime soon as this would be a breaking change to everything. Can you please explain the use case for needing to implementing a server -- there may be other patterns you could use I am thinking. |
You need it if you want to register a service against a gRPC server that was created using the xDS package: https://pkg.go.dev/google.golang.org/grpc/xds#NewGRPCServer That package offers a custom server type that’s different from *grpc.Server. But it does implement grpc.ServiceRegistrar. |
As a workaround you can always generate the files yourself if you need. All public protos are located here: https://github.com/googleapis/googleapis |
Yeah, I’m already working around it by letting Bazel apply a patch against the .pb.go files. |
After some discussion I think will will make the switch sometime in the future, but I don't have a timeline to share. I will leave this issue open for tracking purposes. Thanks for the request |
It looks like the .pb.go files in this repository are being generated with github.com/golang/protobuf/protoc-gen-go. Though this works, it has the annoying side-effect that all
Register*Server()
functions depend on concrete type*grpc.Server
instead ofgrpc.ServiceRegistrar
. This makes it harder to stub out gRPC server implementations. See: golang/protobuf#1378Would it be possible to alter this repo to use protoc-gen-go-rpc instead?
The text was updated successfully, but these errors were encountered: