1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-12 02:30:41 +09:00

WIP test sync protocol

This commit is contained in:
mcrakhman 2024-06-02 14:55:11 +02:00
parent 20b64b3940
commit fb18c54702
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
35 changed files with 849 additions and 152 deletions

View file

@ -0,0 +1,34 @@
package synctest
import (
"github.com/gogo/protobuf/proto"
"github.com/anyproto/any-sync/commonspace/sync/synctestproto"
)
type CounterRequest struct {
peerId string
*synctestproto.CounterRequest
}
func (c CounterRequest) Proto() proto.Message {
return c.CounterRequest
}
func NewCounterRequest(peerId, objectId string, counters []int32) CounterRequest {
return CounterRequest{
peerId: peerId,
CounterRequest: &synctestproto.CounterRequest{
ExistingValues: counters,
ObjectId: objectId,
},
}
}
func (c CounterRequest) PeerId() string {
return c.peerId
}
func (c CounterRequest) ObjectId() string {
return c.CounterRequest.ObjectId
}