Skip to content

Commit

Permalink
Merge pull request #31 from astromechza/main
Browse files Browse the repository at this point in the history
Export the LoadSyncMessage function
  • Loading branch information
ConradIrwin authored Oct 30, 2024
2 parents b7d9d51 + 65b8d49 commit 6fb4f2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sync_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 6fb4f2d

Please sign in to comment.