MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / WithForwardResponseRewriter

Function WithForwardResponseRewriter

runtime/mux.go:95–99  ·  view source on GitHub ↗

WithForwardResponseRewriter returns a ServeMuxOption that allows for implementers to insert logic that can rewrite the final response before it is forwarded. The response rewriter function is called during unary message forwarding, stream message forwarding and when errors are being forwarded. NOT

(fwdResponseRewriter ForwardResponseRewriter)

Source from the content-addressed store, hash-verified

93// NOTE: Using this option will likely make what is generated by `protoc-gen-openapiv2` incorrect.
94// Since this option involves making runtime changes to the response shape or type.
95func WithForwardResponseRewriter(fwdResponseRewriter ForwardResponseRewriter) ServeMuxOption {
96 return func(sm *ServeMux) {
97 sm.forwardResponseRewriter = fwdResponseRewriter
98 }
99}
100
101// WithForwardResponseOption returns a ServeMuxOption representing the forwardResponseOption.
102//

Callers 2

TestDefaultHTTPErrorFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestDefaultHTTPErrorFunction · 0.74