Skip to content
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

Generate constants for full method names #471

Closed
pkwarren opened this issue Mar 3, 2023 · 3 comments
Closed

Generate constants for full method names #471

pkwarren opened this issue Mar 3, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@pkwarren
Copy link
Contributor

pkwarren commented Mar 3, 2023

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: bufbuild/plugins#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

@pkwarren pkwarren added the enhancement New feature or request label Mar 3, 2023
@bufdev
Copy link
Member

bufdev commented Mar 4, 2023

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

@akshayjshah
Copy link
Member

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
Copy link
Member

bufdev commented Mar 9, 2023

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants