1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-06-17 20:50:03 +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)
}
// DEPRECATED: use NewPlainObjectStream
// PlainObjectCodec reads/writes plain JSON-RPC 2.0 objects without a header.
//
// Deprecated: use NewPlainObjectStream
type PlainObjectCodec struct {
decoder *json.Decoder
encoder *json.Encoder
@ -192,6 +193,7 @@ func (c PlainObjectCodec) ReadObject(stream *bufio.Reader, v interface{}) error
return json.NewDecoder(stream).Decode(v)
}
// plainObjectStream reads/writes plain JSON-RPC 2.0 objects without a header.
type plainObjectStream struct {
conn io.Closer
decoder *json.Decoder
@ -199,7 +201,6 @@ type plainObjectStream struct {
mu sync.Mutex
}
// plainObjectStream reads/writes plain JSON-RPC 2.0 objects without a header.
func NewPlainObjectStream(conn io.ReadWriteCloser) ObjectStream {
os := &plainObjectStream{conn: conn}
os.encoder = json.NewEncoder(conn)