MCPcopy Create free account
hub / github.com/CPChain/chain / jsonCodec

Struct jsonCodec

api/rpc/json.go:78–86  ·  view source on GitHub ↗

jsonCodec reads and writes JSON-RPC messages to the underlying connection. It also has support for parsing arguments and serializing (result) objects.

Source from the content-addressed store, hash-verified

76// jsonCodec reads and writes JSON-RPC messages to the underlying connection. It
77// also has support for parsing arguments and serializing (result) objects.
78type 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
88func (err *jsonError) Error() string {
89 if err.Message == "" {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected