MCPcopy
hub / github.com/micro/go-micro / newCodec

Method newCodec

client/rpc_client.go:67–77  ·  view source on GitHub ↗
(contentType string)

Source from the content-addressed store, hash-verified

65}
66
67func (r *rpcClient) newCodec(contentType string) (codec.NewCodec, error) {
68 if c, ok := r.opts.Codecs[contentType]; ok {
69 return c, nil
70 }
71
72 if cf, ok := DefaultCodecs[contentType]; ok {
73 return cf, nil
74 }
75
76 return nil, fmt.Errorf("unsupported Content-Type: %s", contentType)
77}
78
79func (r *rpcClient) call(
80 ctx context.Context,

Callers 3

callMethod · 0.95
streamMethod · 0.95
PublishMethod · 0.95

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected