connectrpc / connect-go

The Go implementation of Connect: Protobuf RPC that works.
https://connectrpc.com
Apache License 2.0
3.01k stars 102 forks source link

Generate constants for full method names #471

Closed pkwarren closed 1 year ago

pkwarren commented 1 year ago

Is your feature request related to a problem? Please describe. It would be convenient in some cases to have access to the full method name for each method. Previous attempts to add this data required separate plugins: https://github.com/bufbuild/plugins/issues/264

Describe the solution you'd like Add the full method name as a constant in the generated .go code.

Describe alternatives you've considered n/a

Additional context n/a

bufdev commented 1 year ago

I'd like to make sure this is necessary before we potentially pollute the generated code.

akshayjshah commented 1 year ago

I'd like to make sure this is necessary before we potentially pollute the generated code.

Ack. This comes up pretty often (#326, #383, Slack, in person with https://github.com/cuebox) - the most common use case is exempting some RPCs from logging or auth middleware without hard-coding a string literal. The best available workaround is not very good, so IMO this is worthwhile.

bufdev commented 1 year ago

Ok