1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-06-16 04:04:56 +02:00
Commit graph

7 commits

Author SHA1 Message Date
lhchavez
d6ac66e24f
Add a way to specify more non-standard-compliant fields to Request (#50)
This change introduces `ExtraField`, a `CallOption` that can add
arbitrary fields to the top-level JSON-RPC Request message.
2021-08-04 14:45:59 +02:00
s3rj1k
81af42d766 minor logging fixes
Signed-off-by: s3rj1k <evasive.gyron@gmail.com>
2019-11-07 23:44:16 +02:00
Quinn Slack
cffa092597 better null handling in (Request).params and (Response).result (#7)
This makes the MarshalJSON/UnmarshalJSON methods centralize the logic, instead of requiring callers to occasionally munge responses to make them valid to later JSON-marshal.
2017-01-26 02:18:31 -08:00
Quinn Slack
64d0b93a7a propagate JSON "null" result instead of treating it as Go nil (and field-not-present in JSON) 2017-01-22 16:05:00 -08:00
Quinn Slack
9edf388fe1 do not suppress error in TestAnyMessage 2017-01-22 15:34:24 -08:00
Quinn Slack
d58e8cc226 support responses with null result ({"result":null})
Previously, we incorrectly interpreted these as neither a request nor a response, and we printed an error for them. This is incorrect behavior per JSON-RPC 2.0 spec; responses can have a null result.
2017-01-22 15:34:05 -08:00
Quinn Slack
6e06d561ec Add pluggable transport interface + WebSocket support
simplify API by using interface{}, rename from transport -> stream

add WebSocket transport in websocket subpackage

do not buffer in ReadObject, rename GetObjectReader/ReadObject -> NextObjectReader

use xtest (jsonrpc2_test) package to allow us to test subpackages that depend on us (in a future change)

factor out vscode-specific transport code and allow pluggable transports

remove Server (unused) and Serve (unnecessary):
  The Serve func had nothing specific to JSON-RPC; it was just a loop
  around (net.Listener).Accept. It added no value.
2016-12-17 18:35:34 -08:00