MCPcopy
hub / github.com/grpc/grpc-go / ForceServerCodec

Function ForceServerCodec

server.go:393–397  ·  view source on GitHub ↗

ForceServerCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling. This will override any lookups by content-subtype for Codecs registered with RegisterCodec. See Content-Type on https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for more detail

(codec encoding.Codec)

Source from the content-addressed store, hash-verified

391// Notice: This API is EXPERIMENTAL and may be changed or removed in a
392// later release.
393func ForceServerCodec(codec encoding.Codec) ServerOption {
394 return newFuncServerOption(func(o *serverOptions) {
395 o.codec = newCodecV1Bridge(codec)
396 })
397}
398
399// ForceServerCodecV2 is the equivalent of ForceServerCodec, but for the new
400// CodecV2 interface.

Callers

nothing calls this directly

Calls 2

newFuncServerOptionFunction · 0.85
newCodecV1BridgeFunction · 0.85

Tested by

no test coverage detected