delegate-go provides client and server delegate implementations for the
cmd-stream library, based on the client.Delegate and server.Delegate
interfaces defined in core-go. Both delegates utilize an abstract transport
layer for robust 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
client.ReconnectDelegateinterface, providing aReconnectmethod that should be invoked by the client if the connection to the server is lost.