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

Method getCodec

server.go:2029–2042  ·  view source on GitHub ↗

contentSubtype must be lowercase cannot return nil

(contentSubtype string)

Source from the content-addressed store, hash-verified

2027// contentSubtype must be lowercase
2028// cannot return nil
2029func (s *Server) getCodec(contentSubtype string) baseCodec {
2030 if s.opts.codec != nil {
2031 return s.opts.codec
2032 }
2033 if contentSubtype == "" {
2034 return getCodec(proto.Name)
2035 }
2036 codec := getCodec(contentSubtype)
2037 if codec == nil {
2038 logger.Warningf("Unsupported codec %q. Defaulting to %q for now. This will start to fail in future releases.", contentSubtype, proto.Name)
2039 return getCodec(proto.Name)
2040 }
2041 return codec
2042}
2043
2044type serverKey struct{}
2045

Callers 3

sendResponseMethod · 0.95
processUnaryRPCMethod · 0.95
processStreamingRPCMethod · 0.95

Calls 2

getCodecFunction · 0.85
WarningfMethod · 0.65

Tested by

no test coverage detected