1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-07-04 08:13:40 +02:00

doc fixes

This commit is contained in:
Michał Nowotnik 2022-07-08 18:27:25 +02:00
parent f498bfa550
commit 85ee4c48f5

View file

@ -169,8 +169,9 @@ func (VSCodeObjectCodec) ReadObject(stream *bufio.Reader, v interface{}) error {
return json.NewDecoder(io.LimitReader(stream, int64(contentLength))).Decode(v) return json.NewDecoder(io.LimitReader(stream, int64(contentLength))).Decode(v)
} }
// DEPRECATED: use NewPlainObjectStream
// PlainObjectCodec reads/writes plain JSON-RPC 2.0 objects without a header. // PlainObjectCodec reads/writes plain JSON-RPC 2.0 objects without a header.
//
// Deprecated: use NewPlainObjectStream
type PlainObjectCodec struct { type PlainObjectCodec struct {
decoder *json.Decoder decoder *json.Decoder
encoder *json.Encoder encoder *json.Encoder
@ -192,6 +193,7 @@ func (c PlainObjectCodec) ReadObject(stream *bufio.Reader, v interface{}) error
return json.NewDecoder(stream).Decode(v) return json.NewDecoder(stream).Decode(v)
} }
// plainObjectStream reads/writes plain JSON-RPC 2.0 objects without a header.
type plainObjectStream struct { type plainObjectStream struct {
conn io.Closer conn io.Closer
decoder *json.Decoder decoder *json.Decoder
@ -199,7 +201,6 @@ type plainObjectStream struct {
mu sync.Mutex mu sync.Mutex
} }
// plainObjectStream reads/writes plain JSON-RPC 2.0 objects without a header.
func NewPlainObjectStream(conn io.ReadWriteCloser) ObjectStream { func NewPlainObjectStream(conn io.ReadWriteCloser) ObjectStream {
os := &plainObjectStream{conn: conn} os := &plainObjectStream{conn: conn}
os.encoder = json.NewEncoder(conn) os.encoder = json.NewEncoder(conn)