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
{{ message }}
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
It would be nice if the generated Provider interface would mimic what gRPC does and add a default ctx context.Context as the first argument.
// inside `provider.go`typeProviderinterface {
GetSomething(ctx context.Context, responses*GetSomethingResponses) (errerror)
}
// and then in the Handler, simply use the context from the incoming request// inside `server.go`funcHandleGetSomething(w http.ResponseWriter, r*http.Request) {
// ... stufferr=provider.GetSomething(r.Context(), responses)
// ... more stuff
}
This would allow passing context from an http.Client, or protecting your handler with a TimeoutMiddleware:
It would be nice if the generated
Provider
interface would mimic whatgRPC
does and add a defaultctx context.Context
as the first argument.This would allow passing
context
from anhttp.Client
, or protecting your handler with aTimeoutMiddleware
:The text was updated successfully, but these errors were encountered: