(contentType string)
| 65 | } |
| 66 | |
| 67 | func (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 | |
| 79 | func (r *rpcClient) call( |
| 80 | ctx context.Context, |