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

WIP sync logic

This commit is contained in:
mcrakhman 2023-07-03 15:48:48 +02:00
parent 145332b0f7
commit 0d16c5d7e4
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
13 changed files with 314 additions and 110 deletions

View file

@ -2,6 +2,7 @@
package spacesyncproto
import (
"github.com/gogo/protobuf/proto"
"storj.io/drpc"
)
@ -16,3 +17,16 @@ func (c ClientFactoryFunc) Client(cc drpc.Conn) DRPCSpaceSyncClient {
type ClientFactory interface {
Client(cc drpc.Conn) DRPCSpaceSyncClient
}
func MarshallSyncMessage(message proto.Marshaler, spaceId, objectId string) (objMsg *ObjectSyncMessage, err error) {
payload, err := message.Marshal()
if err != nil {
return
}
objMsg = &ObjectSyncMessage{
Payload: payload,
ObjectId: objectId,
SpaceId: spaceId,
}
return
}