1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Add datatype and check for periodicsync

This commit is contained in:
mcrakhman 2023-08-08 10:47:04 +02:00
parent b7f39c114f
commit 10687d2dc1
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
9 changed files with 131 additions and 50 deletions

View file

@ -20,6 +20,7 @@ type BuilderContent struct {
ReadKey crypto.SymKey
Content []byte
Timestamp int64
DataType string
}
type InitialContent struct {
@ -169,6 +170,7 @@ func (c *changeBuilder) Build(payload BuilderContent) (ch *Change, rawIdChange *
Timestamp: payload.Timestamp,
Identity: identity,
IsSnapshot: payload.IsSnapshot,
DataType: payload.DataType,
}
if payload.ReadKey != nil {
var encrypted []byte
@ -225,6 +227,7 @@ func (c *changeBuilder) Marshall(ch *Change) (raw *treechangeproto.RawTreeChange
Timestamp: ch.Timestamp,
Identity: identity,
IsSnapshot: ch.IsSnapshot,
DataType: ch.DataType,
}
var marshalled []byte
marshalled, err = treeChange.Marshal()