delegate-go facilitates communication between the cmd-stream-go client
and server. It provides implementations of the core.ClientDelegate and
core.ServerDelegate interfaces, both of which rely on an abstract transport
layer for data exchange.
This module allows the server to initialize the client connection by sending a
ServerInfo message, typically used to indicate a set of supported Commands.
Client creation may fail with an error if the received ServerInfo does not
match the expected one.
Additionally, the client package includes two helper delegates:
- KeepaliveDelegate initiates a ping-pong exchange with the server when no
Commands are pending. It sends the
PingCommand and expects thePongResult, both transmitted as a single zero byte (like a ball). - ReconnectDelegate implements the
core.ClientReconnectDelegateinterface, providing aReconnectmethod that should be invoked by the client if the connection to the server is lost.