Use NewEndpoint to create a synchronization.Endpoint that acts as a proxy for a remotely hosted endpoint. This function performs a compression handshake, sets up Protocol Buffer encoding/decoding, and sends an initial synchronization request to the remote host.
Parameters:
logger: A *logging.Logger for diagnostics.stream: An io.ReadWriteCloser representing the underlying communication channel.root: The root path for the synchronization.session: The session identifier.version: The synchronization.Version to use.configuration: A *synchronization.Configuration object.alpha: A boolean indicating if alpha features are enabled.
Note: If initialization fails, the provided stream is closed. Once successfully established, the endpoint owns the stream and will close it when Shutdown() is called.
func NewEndpoint(
logger *logging.Logger,
stream io.ReadWriteCloser,
root string,
session string,
version synchronization.Version,
configuration *synchronization.Configuration,
alpha bool,
) (synchronization.Endpoint, error)