go/internal/jsonrpc2
Ian Cottrell 434f7a8fef internal/jsonrpc2: add concrete types for Call, Notify and Response
The previous implementation was exposing the details of the wire format
and resulted in non idomatic go, detecting the presence of absence of
values in fields to deterimine the message type.
Now the messages are distinct types and we use type switches instead.
Request still exists as an interface to expose the shared behaviour of
Call and Notification, as this is the type accepted by handlers.
The set of messages is deliberately closed by using a private methods on the
interfaces.

Change-Id: I2cf15ee3923ef4688670c62896f81f760c77fe04
Reviewed-on: https://go-review.googlesource.com/c/tools/+/228719
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2020-04-20 21:05:32 +00:00
..
servertest internal/jsonrpc2: add concrete types for Call, Notify and Response 2020-04-20 21:05:32 +00:00
handler.go internal/jsonrpc2: add concrete types for Call, Notify and Response 2020-04-20 21:05:32 +00:00
jsonrpc2.go internal/jsonrpc2: add concrete types for Call, Notify and Response 2020-04-20 21:05:32 +00:00
jsonrpc2_test.go internal/jsonrpc2: add concrete types for Call, Notify and Response 2020-04-20 21:05:32 +00:00
messages.go internal/jsonrpc2: add concrete types for Call, Notify and Response 2020-04-20 21:05:32 +00:00
serve.go internal/jsonrpc2: clean up the tests 2020-04-20 21:05:12 +00:00
serve_test.go internal/lsp: improve ID formatting 2020-04-10 13:25:36 +00:00
stream.go
wire.go internal/jsonrpc2: make the wire structures private 2020-04-13 01:57:29 +00:00
wire_test.go internal/jsonrpc2: make the wire structures private 2020-04-13 01:57:29 +00:00