From 65b8d499655178e68e89d44c5d15d9a0cd1044b6 Mon Sep 17 00:00:00 2001 From: Ben Meier Date: Sat, 26 Oct 2024 21:53:32 +0100 Subject: [PATCH] Export the LoadSyncMessage function Signed-off-by: Ben Meier --- sync_state.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sync_state.go b/sync_state.go index 710d5aa..4b98460 100644 --- a/sync_state.go +++ b/sync_state.go @@ -41,7 +41,7 @@ func LoadSyncState(d *Doc, raw []byte) (*SyncState, error) { // ReceiveMessage should be called with every message created by GenerateMessage // on the peer side. func (ss *SyncState) ReceiveMessage(msg []byte) (*SyncMessage, error) { - sm, err := loadSyncMessage(msg) + sm, err := LoadSyncMessage(msg) if err != nil { return nil, err } @@ -86,7 +86,8 @@ type SyncMessage struct { cSyncMessage *C.AMsyncMessage } -func loadSyncMessage(msg []byte) (*SyncMessage, error) { +// LoadSyncMessage decodes a sync message from a byte slice for inspection. +func LoadSyncMessage(msg []byte) (*SyncMessage, error) { cBytes, free := toByteSpan(msg) defer free()