-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The goal of this task is to establish a simple protocol at the byte transmission level.
Firstly, we need to define a message format. JSON messages should be used, which must contain the message type (in string format) and its content as a sequence of bytes.
Secondly, we need to create a mechanism that allows us to connect to io.Reader and attach handlers to it that can respond to a specific type of message. This mechanism should assume that each message is separated by a newline character.
Thirdly, we need to create a mechanism to connect to io.Writer, which provides an abstraction for sending messages. Each message must be separated by a newline character. Since JSON cannot be formatted, any newlines must be correctly converted using escape sequences.
It is important to include a description of the wire format in the readme file.