jsonCodec reads and writes JSON-RPC messages to the underlying connection. It also has support for parsing arguments and serializing (result) objects.
| 76 | // jsonCodec reads and writes JSON-RPC messages to the underlying connection. It |
| 77 | // also has support for parsing arguments and serializing (result) objects. |
| 78 | type jsonCodec struct { |
| 79 | closer sync.Once // close closed channel once |
| 80 | closed chan interface{} // closed on Close |
| 81 | decMu sync.Mutex // guards the decoder |
| 82 | decode func(v interface{}) error // decoder to allow multiple transports |
| 83 | encMu sync.Mutex // guards the encoder |
| 84 | encode func(v interface{}) error // encoder to allow multiple transports |
| 85 | rw io.ReadWriteCloser // connection |
| 86 | } |
| 87 | |
| 88 | func (err *jsonError) Error() string { |
| 89 | if err.Message == "" { |
nothing calls this directly
no outgoing calls
no test coverage detected