-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add runtime.WithForwardResponseOption #53
Conversation
I'm not sure on the Travis build failure - advise? |
Tests passing on travis now |
Ping :) |
Added http error code and error status for responseStreamChunk error
Hey @yugui, what do you think of this PR? I need this ASAP, can we pursue this? |
@peter-edge sorry for being late. I'll take a look. |
if _, err = w.Write(buf); err != nil { | ||
glog.Errorf("Failed to write response: %v", err) | ||
} | ||
} | ||
|
||
func handleForwardResponseOptions(ctx context.Context, w http.ResponseWriter, resp proto.Message, opts []func(context.Context, http.ResponseWriter, proto.Message) error) error { | ||
if opts == nil || len(opts) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opts == nil
is redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Could you resolve the merge conflict? |
merge conflict fixed |
Add runtime.WithForwardResponseOption
…tNextMaintenanceTime_api Feature/add get next maintenance time api
This one may be a bit more work back and forth. The idea is that sometimes, you want to be able to modify values prior to sending the response over the wire. An example of this is https://go.pedge.io/dockervolume - I'd like to be able to modify the VolumeDriver interface to be a Protocol Buffers interface, and then use grpc-gateway to handle the API calls, but to do so, I need to be able to set a custom content type for API versioning with Docker.
This change should be backwards compatible. It also includes the changes from #52 so that the tests pass.