You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have some code that uses connect.Error, but need to serve HTTP text responses to serve a Prometheus-compatible endpoint. I'd love to use the same auth code that my connect endpoints use for my HTTP endpoint, but I need to map the status codes.
Describe the solution you'd like
There's a helpful function connectCodeToHTTP, but it's private. Could we expose this function?
Describe alternatives you've considered
Copy-paste this function, or build some other error class, but would love to use this one
The text was updated successfully, but these errors were encountered:
We are definitely batting around the best way to expose lower-level protocol details and implementation code. We were thinking of creating a separate connect-protocol-go repo that connect-go could import, and then we could use that other repo from other tools that want to do more with the protocol without necessarily reimplementing it (such as vanguard-go). The main reason to not add it directly to this repo is just to keep the surface area for Connect users simple and small (most users won't have reason to go down to protocol-level details).
An alternate formulation for exposing this functionality could be an HTTPStatus method on connect.Code. We could also add the inverse in the form of a CodeFromHTTPStatus(int) Code function. A downside for the former, or even exporting ConnectCodeToHTTP, is these might imply to users that these HTTP status codes are always used for these codes. That would be misleading since the HTTP status code is frequently 200, with the Connect Code serialized in the body or in trailers (depending on stream type and whether gRPC or gRPC-Web is used instead of the Connect protocol).
Is your feature request related to a problem? Please describe.
I have some code that uses connect.Error, but need to serve HTTP text responses to serve a Prometheus-compatible endpoint. I'd love to use the same auth code that my connect endpoints use for my HTTP endpoint, but I need to map the status codes.
Describe the solution you'd like
There's a helpful function
connectCodeToHTTP
, but it's private. Could we expose this function?Describe alternatives you've considered
Copy-paste this function, or build some other error class, but would love to use this one
The text was updated successfully, but these errors were encountered: