Processed classes implement the "json.Marshaler/Unmarshaler" interfaces.

This commit is contained in:
Joachim Bauch
2022-05-16 15:13:50 +02:00
parent 68f0393842
commit 7267a0c92d
3 changed files with 22 additions and 0 deletions
+6
View File
@@ -35,6 +35,9 @@ const (
// ClientMessage is a message that is sent from a client to the server.
type ClientMessage struct {
json.Marshaler
json.Unmarshaler
// The unique request id (optional).
Id string `json:"id,omitempty"`
@@ -129,6 +132,9 @@ func (m *ClientMessage) NewWrappedErrorServerMessage(e error) *ServerMessage {
// ServerMessage is a message that is sent from the server to a client.
type ServerMessage struct {
json.Marshaler
json.Unmarshaler
Id string `json:"id,omitempty"`
Type string `json:"type"`