diff --git a/pkg/acl/tree/acltree.go b/pkg/acl/tree/acltree.go index 8ea8b098..caefb1fb 100644 --- a/pkg/acl/tree/acltree.go +++ b/pkg/acl/tree/acltree.go @@ -283,15 +283,16 @@ func (a *aclTree) AddRawChanges(ctx context.Context, rawChanges ...*aclpb.RawCha return } - if a.updateListener != nil { - switch mode { - case Append: - a.updateListener.Update(a) - case Rebuild: - a.updateListener.Rebuild(a) - default: - break - } + if a.updateListener == nil { + return + } + switch mode { + case Append: + a.updateListener.Update(a) + case Rebuild: + a.updateListener.Rebuild(a) + default: + break } }() @@ -317,16 +318,7 @@ func (a *aclTree) AddRawChanges(ctx context.Context, rawChanges ...*aclpb.RawCha } prevHeads := a.tree.Heads() - mode = a.tree.Add(changes...) - switch mode { - case Nothing: - return AddResult{ - OldHeads: prevHeads, - Heads: prevHeads, - Summary: AddResultSummaryNothing, - }, nil - - case Rebuild: + rebuild := func() (AddResult, error) { err = a.rebuildFromStorage() if err != nil { return AddResult{}, err @@ -338,6 +330,26 @@ func (a *aclTree) AddRawChanges(ctx context.Context, rawChanges ...*aclpb.RawCha Added: getAddedChanges(), Summary: AddResultSummaryRebuild, }, nil + } + + mode = a.tree.Add(changes...) + switch mode { + case Nothing: + for _, ch := range changes { + // rebuilding if the snapshot is different from the root + if ch.SnapshotId != a.tree.RootId() { + return rebuild() + } + } + + return AddResult{ + OldHeads: prevHeads, + Heads: prevHeads, + Summary: AddResultSummaryNothing, + }, nil + + case Rebuild: + return rebuild() default: // just rebuilding the state from start without reloading everything from tree storage // as an optimization we could've started from current heads, but I didn't implement that diff --git a/pkg/acl/tree/doctree.go b/pkg/acl/tree/doctree.go index d60de112..bd056a72 100644 --- a/pkg/acl/tree/doctree.go +++ b/pkg/acl/tree/doctree.go @@ -165,7 +165,9 @@ func (d *docTree) AddContent(ctx context.Context, aclTree ACLTree, content proto defer func() { // TODO: should this be called in a separate goroutine to prevent accidental cycles (tree->updater->tree) - d.updateListener.Update(d) + if d.updateListener != nil { + d.updateListener.Update(d) + } }() state := aclTree.ACLState() change := &aclpb.Change{ @@ -256,6 +258,10 @@ func (d *docTree) AddRawChanges(ctx context.Context, aclTree ACLTree, rawChanges return } + if d.updateListener == nil { + return + } + switch mode { case Append: d.updateListener.Update(d) diff --git a/service/sync/message/service.go b/service/sync/message/service.go index efe76900..1f679200 100644 --- a/service/sync/message/service.go +++ b/service/sync/message/service.go @@ -2,6 +2,7 @@ package message import ( "context" + "fmt" "github.com/anytypeio/go-anytype-infrastructure-experiments/app" "github.com/anytypeio/go-anytype-infrastructure-experiments/app/logger" "github.com/anytypeio/go-anytype-infrastructure-experiments/service/net/pool" @@ -85,7 +86,7 @@ func (s *service) SendMessageAsync(peerId string, msg *syncproto.Sync) (err erro return } - go s.sendAsync(peerId, msgType(msg), marshalled) + go s.sendAsync(peerId, msgInfo(msg), marshalled) return } @@ -108,15 +109,16 @@ func (s *service) sendAsync(peerId string, msgTypeStr string, marshalled []byte) }) } -func msgType(content *syncproto.Sync) string { +func msgInfo(content *syncproto.Sync) (syncMethod string) { msg := content.GetMessage() switch { case msg.GetFullSyncRequest() != nil: - return "FullSyncRequest" + syncMethod = "FullSyncRequest" case msg.GetFullSyncResponse() != nil: - return "FullSyncResponse" + syncMethod = "FullSyncResponse" case msg.GetHeadUpdate() != nil: - return "HeadUpdate" + syncMethod = "HeadUpdate" } - return "UnknownMessage" + syncMethod = fmt.Sprintf("method: %s, treeType: %s", syncMethod, content.TreeHeader.Type.String()) + return } diff --git a/service/sync/requesthandler/requesthandler.go b/service/sync/requesthandler/requesthandler.go index 4892ef14..3ffbda84 100644 --- a/service/sync/requesthandler/requesthandler.go +++ b/service/sync/requesthandler/requesthandler.go @@ -64,26 +64,32 @@ func (r *requestHandler) HandleSyncMessage(ctx context.Context, senderId string, msg := content.GetMessage() switch { case msg.GetFullSyncRequest() != nil: - return r.HandleFullSyncRequest(ctx, senderId, msg.GetFullSyncRequest()) + return r.HandleFullSyncRequest(ctx, senderId, msg.GetFullSyncRequest(), content.GetTreeHeader(), content.GetTreeId()) case msg.GetFullSyncResponse() != nil: - return r.HandleFullSyncResponse(ctx, senderId, msg.GetFullSyncResponse()) + return r.HandleFullSyncResponse(ctx, senderId, msg.GetFullSyncResponse(), content.GetTreeHeader(), content.GetTreeId()) case msg.GetHeadUpdate() != nil: - return r.HandleHeadUpdate(ctx, senderId, msg.GetHeadUpdate()) + return r.HandleHeadUpdate(ctx, senderId, msg.GetHeadUpdate(), content.GetTreeHeader(), content.GetTreeId()) } return nil } -func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, update *syncproto.SyncHeadUpdate) (err error) { +func (r *requestHandler) HandleHeadUpdate( + ctx context.Context, + senderId string, + update *syncproto.SyncHeadUpdate, + header *treepb.TreeHeader, + treeId string) (err error) { + var ( fullRequest *syncproto.SyncFullRequest snapshotPath []string result tree.AddResult ) - log.With(zap.String("peerId", senderId), zap.String("treeId", update.TreeId)). + log.With(zap.String("peerId", senderId), zap.String("treeId", treeId)). Debug("processing head update") updateACLTree := func() { - err = r.treeCache.Do(ctx, update.TreeId, func(obj interface{}) error { + err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error { t := obj.(tree.ACLTree) t.Lock() defer t.Unlock() @@ -97,7 +103,7 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, shouldFullSync := !slice.UnsortedEquals(update.Heads, t.Heads()) snapshotPath = t.SnapshotPath() if shouldFullSync { - fullRequest, err = r.prepareFullSyncRequest(update.TreeId, update.TreeHeader, update.SnapshotPath, t) + fullRequest, err = r.prepareFullSyncRequest(treeId, header, update.SnapshotPath, t) if err != nil { return err } @@ -107,12 +113,12 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, } updateDocTree := func() { - err = r.treeCache.Do(ctx, update.TreeId, func(obj interface{}) error { + err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error { docTree := obj.(tree.DocTree) docTree.Lock() defer docTree.Unlock() - return r.treeCache.Do(ctx, update.TreeId, func(obj interface{}) error { + return r.treeCache.Do(ctx, treeId, func(obj interface{}) error { aclTree := obj.(tree.ACLTree) aclTree.RLock() defer aclTree.RUnlock() @@ -126,7 +132,7 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, shouldFullSync := !slice.UnsortedEquals(update.Heads, docTree.Heads()) snapshotPath = docTree.SnapshotPath() if shouldFullSync { - fullRequest, err = r.prepareFullSyncRequest(update.TreeId, update.TreeHeader, update.SnapshotPath, docTree) + fullRequest, err = r.prepareFullSyncRequest(treeId, header, update.SnapshotPath, docTree) if err != nil { return err } @@ -136,7 +142,7 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, }) } - switch update.TreeHeader.Type { + switch header.Type { case treepb.TreeHeader_ACLTree: updateACLTree() case treepb.TreeHeader_DocTree: @@ -148,14 +154,11 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, // if there are no such tree if err == treestorage.ErrUnknownTreeId { // TODO: maybe we can optimize this by sending the header and stuff right away, so when the tree is created we are able to add it on first request - fullRequest = &syncproto.SyncFullRequest{ - TreeId: update.TreeId, - TreeHeader: update.TreeHeader, - } + fullRequest = &syncproto.SyncFullRequest{} } // if we have incompatible heads, or we haven't seen the tree at all if fullRequest != nil { - return r.messageService.SendMessageAsync(senderId, syncproto.WrapFullRequest(fullRequest)) + return r.messageService.SendMessageAsync(senderId, syncproto.WrapFullRequest(fullRequest, header, treeId)) } // if error or nothing has changed if err != nil || len(result.Added) == 0 { @@ -166,23 +169,27 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, Heads: result.Heads, Changes: result.Added, SnapshotPath: snapshotPath, - TreeId: update.TreeId, - TreeHeader: update.TreeHeader, } - return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate)) + return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate, header, treeId)) } -func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId string, request *syncproto.SyncFullRequest) (err error) { +func (r *requestHandler) HandleFullSyncRequest( + ctx context.Context, + senderId string, + request *syncproto.SyncFullRequest, + header *treepb.TreeHeader, + treeId string) (err error) { + var ( fullResponse *syncproto.SyncFullResponse snapshotPath []string result tree.AddResult ) - log.With(zap.String("peerId", senderId), zap.String("treeId", request.TreeId)). + log.With(zap.String("peerId", senderId), zap.String("treeId", treeId)). Debug("processing full sync request") requestACLTree := func() { - err = r.treeCache.Do(ctx, request.TreeId, func(obj interface{}) error { + err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error { t := obj.(tree.ACLTree) t.Lock() defer t.Unlock() @@ -196,7 +203,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str } } snapshotPath = t.SnapshotPath() - fullResponse, err = r.prepareFullSyncResponse(request.TreeId, request.SnapshotPath, request.Changes, t) + fullResponse, err = r.prepareFullSyncResponse(treeId, request.SnapshotPath, request.Changes, t) if err != nil { return err } @@ -205,12 +212,12 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str } requestDocTree := func() { - err = r.treeCache.Do(ctx, request.TreeId, func(obj interface{}) error { + err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error { docTree := obj.(tree.DocTree) docTree.Lock() defer docTree.Unlock() - return r.treeCache.Do(ctx, request.TreeId, func(obj interface{}) error { + return r.treeCache.Do(ctx, treeId, func(obj interface{}) error { aclTree := obj.(tree.ACLTree) aclTree.RLock() defer aclTree.RUnlock() @@ -223,7 +230,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str } } snapshotPath = docTree.SnapshotPath() - fullResponse, err = r.prepareFullSyncResponse(request.TreeId, request.SnapshotPath, request.Changes, docTree) + fullResponse, err = r.prepareFullSyncResponse(treeId, request.SnapshotPath, request.Changes, docTree) if err != nil { return err } @@ -232,7 +239,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str }) } - switch request.TreeHeader.Type { + switch header.Type { case treepb.TreeHeader_ACLTree: requestACLTree() case treepb.TreeHeader_DocTree: @@ -244,7 +251,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str if err != nil { return err } - err = r.messageService.SendMessageAsync(senderId, syncproto.WrapFullResponse(fullResponse)) + err = r.messageService.SendMessageAsync(senderId, syncproto.WrapFullResponse(fullResponse, header, treeId)) // if error or nothing has changed if err != nil || len(result.Added) == 0 { return err @@ -255,22 +262,26 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str Heads: result.Heads, Changes: result.Added, SnapshotPath: snapshotPath, - TreeId: request.TreeId, - TreeHeader: request.TreeHeader, } - return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate)) + return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate, header, treeId)) } -func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId string, response *syncproto.SyncFullResponse) (err error) { +func (r *requestHandler) HandleFullSyncResponse( + ctx context.Context, + senderId string, + response *syncproto.SyncFullResponse, + header *treepb.TreeHeader, + treeId string) (err error) { + var ( snapshotPath []string result tree.AddResult ) - log.With(zap.String("peerId", senderId), zap.String("treeId", response.TreeId)). + log.With(zap.String("peerId", senderId), zap.String("treeId", treeId)). Debug("processing full sync response") responseACLTree := func() { - err = r.treeCache.Do(ctx, response.TreeId, func(obj interface{}) error { + err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error { t := obj.(tree.ACLTree) t.Lock() defer t.Unlock() @@ -285,12 +296,12 @@ func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId st } responseDocTree := func() { - err = r.treeCache.Do(ctx, response.TreeId, func(obj interface{}) error { + err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error { docTree := obj.(tree.DocTree) docTree.Lock() defer docTree.Unlock() - return r.treeCache.Do(ctx, response.TreeId, func(obj interface{}) error { + return r.treeCache.Do(ctx, treeId, func(obj interface{}) error { aclTree := obj.(tree.ACLTree) aclTree.RLock() defer aclTree.RUnlock() @@ -305,7 +316,7 @@ func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId st }) } - switch response.TreeHeader.Type { + switch header.Type { case treepb.TreeHeader_ACLTree: responseACLTree() case treepb.TreeHeader_DocTree: @@ -320,7 +331,7 @@ func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId st } // if we have a new tree if err == treestorage.ErrUnknownTreeId { - err = r.createTree(ctx, response) + err = r.createTree(ctx, response, header, treeId) if err != nil { return err } @@ -335,9 +346,8 @@ func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId st Heads: result.Heads, Changes: result.Added, SnapshotPath: snapshotPath, - TreeId: response.TreeId, } - return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate)) + return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate, header, treeId)) } func (r *requestHandler) prepareFullSyncRequest(treeId string, header *treepb.TreeHeader, theirPath []string, t tree.CommonTree) (*syncproto.SyncFullRequest, error) { @@ -348,9 +358,7 @@ func (r *requestHandler) prepareFullSyncRequest(treeId string, header *treepb.Tr return &syncproto.SyncFullRequest{ Heads: t.Heads(), Changes: ourChanges, - TreeId: treeId, SnapshotPath: t.SnapshotPath(), - TreeHeader: header, }, nil } @@ -382,17 +390,20 @@ func (r *requestHandler) prepareFullSyncResponse( return &syncproto.SyncFullResponse{ Heads: t.Heads(), Changes: final, - TreeId: treeId, SnapshotPath: t.SnapshotPath(), - TreeHeader: t.Header(), }, nil } -func (r *requestHandler) createTree(ctx context.Context, response *syncproto.SyncFullResponse) error { +func (r *requestHandler) createTree( + ctx context.Context, + response *syncproto.SyncFullResponse, + header *treepb.TreeHeader, + treeId string) error { + return r.treeCache.Add( ctx, - response.TreeId, - response.TreeHeader, + treeId, + header, response.Changes, func(obj interface{}) error { return nil diff --git a/service/treecache/service.go b/service/treecache/service.go index 1816e688..a6d215ba 100644 --- a/service/treecache/service.go +++ b/service/treecache/service.go @@ -6,7 +6,6 @@ import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/app" "github.com/anytypeio/go-anytype-infrastructure-experiments/app/logger" "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb" - "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/acltree" "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/tree" "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treestorage/treepb" "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/ocache" @@ -19,7 +18,6 @@ const CName = "treecache" // TODO: add context type TreeFunc = func(tree interface{}) error -type ChangeBuildFunc = func(builder acltree.ChangeBuilder) error var log = logger.NewNamed("treecache") diff --git a/syncproto/helpers.go b/syncproto/helpers.go index e3059bda..38bd5cf1 100644 --- a/syncproto/helpers.go +++ b/syncproto/helpers.go @@ -1,19 +1,33 @@ package syncproto -func WrapHeadUpdate(update *SyncHeadUpdate) *Sync { - return &Sync{Message: &SyncContentValue{ - Value: &SyncContentValueValueOfHeadUpdate{HeadUpdate: update}, - }} +import "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treestorage/treepb" + +func WrapHeadUpdate(update *SyncHeadUpdate, header *treepb.TreeHeader, treeId string) *Sync { + return &Sync{ + Message: &SyncContentValue{ + Value: &SyncContentValueValueOfHeadUpdate{HeadUpdate: update}, + }, + TreeHeader: header, + TreeId: treeId, + } } -func WrapFullRequest(request *SyncFullRequest) *Sync { - return &Sync{Message: &SyncContentValue{ - Value: &SyncContentValueValueOfFullSyncRequest{FullSyncRequest: request}, - }} +func WrapFullRequest(request *SyncFullRequest, header *treepb.TreeHeader, treeId string) *Sync { + return &Sync{ + Message: &SyncContentValue{ + Value: &SyncContentValueValueOfFullSyncRequest{FullSyncRequest: request}, + }, + TreeHeader: header, + TreeId: treeId, + } } -func WrapFullResponse(response *SyncFullResponse) *Sync { - return &Sync{Message: &SyncContentValue{ - Value: &SyncContentValueValueOfFullSyncResponse{FullSyncResponse: response}, - }} +func WrapFullResponse(response *SyncFullResponse, header *treepb.TreeHeader, treeId string) *Sync { + return &Sync{ + Message: &SyncContentValue{ + Value: &SyncContentValueValueOfFullSyncResponse{FullSyncResponse: response}, + }, + TreeHeader: header, + TreeId: treeId, + } } diff --git a/syncproto/proto/sync.proto b/syncproto/proto/sync.proto index 79b2ef5a..f874f19a 100644 --- a/syncproto/proto/sync.proto +++ b/syncproto/proto/sync.proto @@ -53,6 +53,8 @@ message System { message Sync { string spaceId = 1; ContentValue message = 2; + tree.TreeHeader treeHeader = 3; + string treeId = 4; message ContentValue { oneof value { @@ -65,9 +67,7 @@ message Sync { message HeadUpdate { repeated string heads = 1; repeated acl.RawChange changes = 2; - string treeId = 3; - repeated string snapshotPath = 4; - tree.TreeHeader treeHeader = 5; + repeated string snapshotPath = 3; } message Full { @@ -75,17 +75,13 @@ message Sync { message Request { repeated string heads = 1; repeated acl.RawChange changes = 2; - string treeId = 3; - repeated string snapshotPath = 4; - tree.TreeHeader treeHeader = 5; + repeated string snapshotPath = 3; } message Response { repeated string heads = 1; repeated acl.RawChange changes = 2; - string treeId = 3; - repeated string snapshotPath = 4; - tree.TreeHeader treeHeader = 5; + repeated string snapshotPath = 3; } } } diff --git a/syncproto/sync.pb.go b/syncproto/sync.pb.go index 3b07151f..bf090662 100644 --- a/syncproto/sync.pb.go +++ b/syncproto/sync.pb.go @@ -27,24 +27,21 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MessageType int32 const ( - MessageType_MessageTypeSystem MessageType = 0 - MessageType_MessageTypeSpace MessageType = 1 - MessageType_MessageTypeSync MessageType = 2 - MessageType_MessageTypeFile MessageType = 3 + MessageType_MessageTypeSystem MessageType = 0 + MessageType_MessageTypeSubscription MessageType = 1 + MessageType_MessageTypeSync MessageType = 2 ) var MessageType_name = map[int32]string{ 0: "MessageTypeSystem", - 1: "MessageTypeSpace", + 1: "MessageTypeSubscription", 2: "MessageTypeSync", - 3: "MessageTypeFile", } var MessageType_value = map[string]int32{ - "MessageTypeSystem": 0, - "MessageTypeSpace": 1, - "MessageTypeSync": 2, - "MessageTypeFile": 3, + "MessageTypeSystem": 0, + "MessageTypeSubscription": 1, + "MessageTypeSync": 2, } func (x MessageType) String() string { @@ -452,16 +449,158 @@ func (m *SystemError) GetDescription() string { return "" } +type Subscription struct { + SubscribeSpace *SubscriptionSubscribeSpace `protobuf:"bytes,1,opt,name=subscribeSpace,proto3" json:"subscribeSpace,omitempty"` + UnsubscribeSpace *SubscriptionUnsubscribeSpace `protobuf:"bytes,2,opt,name=unsubscribeSpace,proto3" json:"unsubscribeSpace,omitempty"` +} + +func (m *Subscription) Reset() { *m = Subscription{} } +func (m *Subscription) String() string { return proto.CompactTextString(m) } +func (*Subscription) ProtoMessage() {} +func (*Subscription) Descriptor() ([]byte, []int) { + return fileDescriptor_4b28dfdd48a89166, []int{3} +} +func (m *Subscription) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Subscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Subscription.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Subscription) XXX_Merge(src proto.Message) { + xxx_messageInfo_Subscription.Merge(m, src) +} +func (m *Subscription) XXX_Size() int { + return m.Size() +} +func (m *Subscription) XXX_DiscardUnknown() { + xxx_messageInfo_Subscription.DiscardUnknown(m) +} + +var xxx_messageInfo_Subscription proto.InternalMessageInfo + +func (m *Subscription) GetSubscribeSpace() *SubscriptionSubscribeSpace { + if m != nil { + return m.SubscribeSpace + } + return nil +} + +func (m *Subscription) GetUnsubscribeSpace() *SubscriptionUnsubscribeSpace { + if m != nil { + return m.UnsubscribeSpace + } + return nil +} + +type SubscriptionSubscribeSpace struct { + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` +} + +func (m *SubscriptionSubscribeSpace) Reset() { *m = SubscriptionSubscribeSpace{} } +func (m *SubscriptionSubscribeSpace) String() string { return proto.CompactTextString(m) } +func (*SubscriptionSubscribeSpace) ProtoMessage() {} +func (*SubscriptionSubscribeSpace) Descriptor() ([]byte, []int) { + return fileDescriptor_4b28dfdd48a89166, []int{3, 0} +} +func (m *SubscriptionSubscribeSpace) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SubscriptionSubscribeSpace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SubscriptionSubscribeSpace.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SubscriptionSubscribeSpace) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubscriptionSubscribeSpace.Merge(m, src) +} +func (m *SubscriptionSubscribeSpace) XXX_Size() int { + return m.Size() +} +func (m *SubscriptionSubscribeSpace) XXX_DiscardUnknown() { + xxx_messageInfo_SubscriptionSubscribeSpace.DiscardUnknown(m) +} + +var xxx_messageInfo_SubscriptionSubscribeSpace proto.InternalMessageInfo + +func (m *SubscriptionSubscribeSpace) GetSpaceId() string { + if m != nil { + return m.SpaceId + } + return "" +} + +type SubscriptionUnsubscribeSpace struct { + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` +} + +func (m *SubscriptionUnsubscribeSpace) Reset() { *m = SubscriptionUnsubscribeSpace{} } +func (m *SubscriptionUnsubscribeSpace) String() string { return proto.CompactTextString(m) } +func (*SubscriptionUnsubscribeSpace) ProtoMessage() {} +func (*SubscriptionUnsubscribeSpace) Descriptor() ([]byte, []int) { + return fileDescriptor_4b28dfdd48a89166, []int{3, 1} +} +func (m *SubscriptionUnsubscribeSpace) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SubscriptionUnsubscribeSpace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SubscriptionUnsubscribeSpace.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SubscriptionUnsubscribeSpace) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubscriptionUnsubscribeSpace.Merge(m, src) +} +func (m *SubscriptionUnsubscribeSpace) XXX_Size() int { + return m.Size() +} +func (m *SubscriptionUnsubscribeSpace) XXX_DiscardUnknown() { + xxx_messageInfo_SubscriptionUnsubscribeSpace.DiscardUnknown(m) +} + +var xxx_messageInfo_SubscriptionUnsubscribeSpace proto.InternalMessageInfo + +func (m *SubscriptionUnsubscribeSpace) GetSpaceId() string { + if m != nil { + return m.SpaceId + } + return "" +} + type Sync struct { - SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - Message *SyncContentValue `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` + Message *SyncContentValue `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + TreeHeader *treepb.TreeHeader `protobuf:"bytes,3,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"` + TreeId string `protobuf:"bytes,4,opt,name=treeId,proto3" json:"treeId,omitempty"` } func (m *Sync) Reset() { *m = Sync{} } func (m *Sync) String() string { return proto.CompactTextString(m) } func (*Sync) ProtoMessage() {} func (*Sync) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{3} + return fileDescriptor_4b28dfdd48a89166, []int{4} } func (m *Sync) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -504,6 +643,20 @@ func (m *Sync) GetMessage() *SyncContentValue { return nil } +func (m *Sync) GetTreeHeader() *treepb.TreeHeader { + if m != nil { + return m.TreeHeader + } + return nil +} + +func (m *Sync) GetTreeId() string { + if m != nil { + return m.TreeId + } + return "" +} + type SyncContentValue struct { // Types that are valid to be assigned to Value: // *SyncContentValueValueOfHeadUpdate @@ -516,7 +669,7 @@ func (m *SyncContentValue) Reset() { *m = SyncContentValue{} } func (m *SyncContentValue) String() string { return proto.CompactTextString(m) } func (*SyncContentValue) ProtoMessage() {} func (*SyncContentValue) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{3, 0} + return fileDescriptor_4b28dfdd48a89166, []int{4, 0} } func (m *SyncContentValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -605,16 +758,14 @@ func (*SyncContentValue) XXX_OneofWrappers() []interface{} { type SyncHeadUpdate struct { Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"` Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` - TreeId string `protobuf:"bytes,3,opt,name=treeId,proto3" json:"treeId,omitempty"` - SnapshotPath []string `protobuf:"bytes,4,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` - TreeHeader *treepb.TreeHeader `protobuf:"bytes,5,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"` + SnapshotPath []string `protobuf:"bytes,3,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` } func (m *SyncHeadUpdate) Reset() { *m = SyncHeadUpdate{} } func (m *SyncHeadUpdate) String() string { return proto.CompactTextString(m) } func (*SyncHeadUpdate) ProtoMessage() {} func (*SyncHeadUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{3, 1} + return fileDescriptor_4b28dfdd48a89166, []int{4, 1} } func (m *SyncHeadUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -657,13 +808,6 @@ func (m *SyncHeadUpdate) GetChanges() []*aclpb.RawChange { return nil } -func (m *SyncHeadUpdate) GetTreeId() string { - if m != nil { - return m.TreeId - } - return "" -} - func (m *SyncHeadUpdate) GetSnapshotPath() []string { if m != nil { return m.SnapshotPath @@ -671,13 +815,6 @@ func (m *SyncHeadUpdate) GetSnapshotPath() []string { return nil } -func (m *SyncHeadUpdate) GetTreeHeader() *treepb.TreeHeader { - if m != nil { - return m.TreeHeader - } - return nil -} - type SyncFull struct { } @@ -685,7 +822,7 @@ func (m *SyncFull) Reset() { *m = SyncFull{} } func (m *SyncFull) String() string { return proto.CompactTextString(m) } func (*SyncFull) ProtoMessage() {} func (*SyncFull) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{3, 2} + return fileDescriptor_4b28dfdd48a89166, []int{4, 2} } func (m *SyncFull) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -718,16 +855,14 @@ var xxx_messageInfo_SyncFull proto.InternalMessageInfo type SyncFullRequest struct { Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"` Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` - TreeId string `protobuf:"bytes,3,opt,name=treeId,proto3" json:"treeId,omitempty"` - SnapshotPath []string `protobuf:"bytes,4,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` - TreeHeader *treepb.TreeHeader `protobuf:"bytes,5,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"` + SnapshotPath []string `protobuf:"bytes,3,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` } func (m *SyncFullRequest) Reset() { *m = SyncFullRequest{} } func (m *SyncFullRequest) String() string { return proto.CompactTextString(m) } func (*SyncFullRequest) ProtoMessage() {} func (*SyncFullRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{3, 2, 0} + return fileDescriptor_4b28dfdd48a89166, []int{4, 2, 0} } func (m *SyncFullRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -770,13 +905,6 @@ func (m *SyncFullRequest) GetChanges() []*aclpb.RawChange { return nil } -func (m *SyncFullRequest) GetTreeId() string { - if m != nil { - return m.TreeId - } - return "" -} - func (m *SyncFullRequest) GetSnapshotPath() []string { if m != nil { return m.SnapshotPath @@ -784,26 +912,17 @@ func (m *SyncFullRequest) GetSnapshotPath() []string { return nil } -func (m *SyncFullRequest) GetTreeHeader() *treepb.TreeHeader { - if m != nil { - return m.TreeHeader - } - return nil -} - type SyncFullResponse struct { Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"` Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` - TreeId string `protobuf:"bytes,3,opt,name=treeId,proto3" json:"treeId,omitempty"` - SnapshotPath []string `protobuf:"bytes,4,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` - TreeHeader *treepb.TreeHeader `protobuf:"bytes,5,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"` + SnapshotPath []string `protobuf:"bytes,3,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` } func (m *SyncFullResponse) Reset() { *m = SyncFullResponse{} } func (m *SyncFullResponse) String() string { return proto.CompactTextString(m) } func (*SyncFullResponse) ProtoMessage() {} func (*SyncFullResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{3, 2, 1} + return fileDescriptor_4b28dfdd48a89166, []int{4, 2, 1} } func (m *SyncFullResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -846,13 +965,6 @@ func (m *SyncFullResponse) GetChanges() []*aclpb.RawChange { return nil } -func (m *SyncFullResponse) GetTreeId() string { - if m != nil { - return m.TreeId - } - return "" -} - func (m *SyncFullResponse) GetSnapshotPath() []string { if m != nil { return m.SnapshotPath @@ -860,13 +972,6 @@ func (m *SyncFullResponse) GetSnapshotPath() []string { return nil } -func (m *SyncFullResponse) GetTreeHeader() *treepb.TreeHeader { - if m != nil { - return m.TreeHeader - } - return nil -} - func init() { proto.RegisterEnum("anytype.MessageType", MessageType_name, MessageType_value) proto.RegisterEnum("anytype.SystemErrorCode", SystemErrorCode_name, SystemErrorCode_value) @@ -877,6 +982,9 @@ func init() { proto.RegisterType((*SystemPing)(nil), "anytype.System.Ping") proto.RegisterType((*SystemAck)(nil), "anytype.System.Ack") proto.RegisterType((*SystemError)(nil), "anytype.System.Error") + proto.RegisterType((*Subscription)(nil), "anytype.Subscription") + proto.RegisterType((*SubscriptionSubscribeSpace)(nil), "anytype.Subscription.SubscribeSpace") + proto.RegisterType((*SubscriptionUnsubscribeSpace)(nil), "anytype.Subscription.UnsubscribeSpace") proto.RegisterType((*Sync)(nil), "anytype.Sync") proto.RegisterType((*SyncContentValue)(nil), "anytype.Sync.ContentValue") proto.RegisterType((*SyncHeadUpdate)(nil), "anytype.Sync.HeadUpdate") @@ -888,58 +996,61 @@ func init() { func init() { proto.RegisterFile("syncproto/proto/sync.proto", fileDescriptor_4b28dfdd48a89166) } var fileDescriptor_4b28dfdd48a89166 = []byte{ - // 806 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xd1, 0x6e, 0xe3, 0x44, - 0x14, 0xf5, 0x24, 0x4e, 0xbc, 0xbe, 0xae, 0x5a, 0x33, 0xdb, 0x45, 0xc6, 0xac, 0x22, 0x2b, 0x02, - 0x61, 0x01, 0x72, 0x57, 0x81, 0x15, 0x12, 0x6f, 0xbb, 0xa5, 0x51, 0x22, 0x20, 0x89, 0x26, 0x49, - 0x91, 0x78, 0x59, 0x4d, 0xed, 0xd9, 0x24, 0x8a, 0x3b, 0x36, 0x1e, 0x07, 0xc8, 0x5f, 0xec, 0x37, - 0xf0, 0x0d, 0x48, 0x20, 0xbe, 0x80, 0xc7, 0x7d, 0xe4, 0x11, 0xb5, 0x12, 0x1f, 0x01, 0x2f, 0x68, - 0xc6, 0x76, 0xe2, 0x66, 0xfb, 0x03, 0xfb, 0xd0, 0x66, 0xee, 0xb9, 0xe7, 0x5c, 0x9f, 0x1b, 0xdf, - 0xb9, 0x01, 0x57, 0x6c, 0x79, 0x98, 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8, 0x5d, 0x68, 0xcb, 0x15, 0x52, 0x5e, 0x54, - 0x93, 0x94, 0x11, 0xee, 0xc2, 0x91, 0xe0, 0x34, 0x15, 0xcb, 0x24, 0x9f, 0xd0, 0x7c, 0xe9, 0xe8, - 0xaa, 0xfc, 0x1d, 0x0c, 0x3f, 0x01, 0x90, 0xec, 0x62, 0x57, 0xa8, 0x2b, 0x6a, 0xf5, 0xec, 0x40, - 0x6d, 0xa4, 0xd9, 0x0e, 0x27, 0x35, 0x8e, 0xfb, 0x5f, 0x03, 0x74, 0xd9, 0xab, 0xfb, 0x1b, 0x02, - 0xa3, 0xfa, 0x96, 0xde, 0xae, 0x16, 0x7e, 0x47, 0xf0, 0xa0, 0x7a, 0x2b, 0x6f, 0x97, 0xf5, 0x8f, - 0x23, 0xb0, 0x6a, 0x6b, 0x16, 0x3f, 0x82, 0x77, 0x6a, 0x61, 0xb1, 0x0a, 0x6c, 0x0d, 0x9f, 0x82, - 0x5d, 0x87, 0xe5, 0xad, 0xb4, 0x11, 0x7e, 0x08, 0x27, 0x77, 0xc8, 0x3c, 0xb4, 0x1b, 0x07, 0x60, - 0x7f, 0x15, 0x33, 0xbb, 0xf9, 0xfc, 0x83, 0x3f, 0x6f, 0x3a, 0xe8, 0xf5, 0x4d, 0x07, 0xfd, 0x7d, - 0xd3, 0x41, 0xaf, 0x6e, 0x3b, 0xda, 0xeb, 0xdb, 0x8e, 0xf6, 0xd7, 0x6d, 0x47, 0xfb, 0x1e, 0xce, - 0x76, 0x3f, 0x93, 0x57, 0x6d, 0xf5, 0xf1, 0xd9, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x07, 0xa6, - 0xab, 0xcd, 0x3a, 0x07, 0x00, 0x00, + // 858 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xd1, 0x8e, 0xda, 0x46, + 0x14, 0xc5, 0x60, 0x20, 0x5c,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x46, 0xe2, 0x8d, 0x59, 0x93, + 0x69, 0x6e, 0x61, 0xd6, 0xbf, 0x1a, 0xe8, 0xc2, 0xa0, 0x75, 0x05, 0xcd, 0xac, 0xb3, 0x0f, 0x51, + 0x97, 0xc1, 0x9d, 0xac, 0xfd, 0x0f, 0x51, 0xef, 0xf1, 0x25, 0xb4, 0x0b, 0xc3, 0x1d, 0xdd, 0x87, + 0x8f, 0x0a, 0xa1, 0x1a, 0x40, 0x46, 0x05, 0x3d, 0x80, 0x4f, 0x8a, 0x70, 0xe1, 0x8e, 0x1a, 0x1a, + 0xba, 0x0b, 0x27, 0xb7, 0x34, 0xcc, 0x35, 0xaa, 0x2f, 0x1e, 0xfd, 0x75, 0xdd, 0xd3, 0xde, 0x5e, + 0xf7, 0xb4, 0x7f, 0xae, 0x7b, 0xda, 0x9b, 0x9b, 0x5e, 0xe5, 0xed, 0x4d, 0xaf, 0xf2, 0xf7, 0x4d, + 0xaf, 0xf2, 0x13, 0x9c, 0x1e, 0x5e, 0xc7, 0xab, 0x86, 0xfc, 0xf9, 0xea, 0xff, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x6a, 0x04, 0xc0, 0x87, 0xa2, 0x07, 0x00, 0x00, } func (m *Message) Marshal() (dAtA []byte, err error) { @@ -1223,6 +1334,113 @@ func (m *SystemError) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Subscription) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Subscription) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Subscription) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UnsubscribeSpace != nil { + { + size, err := m.UnsubscribeSpace.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSync(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.SubscribeSpace != nil { + { + size, err := m.SubscribeSpace.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSync(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SubscriptionSubscribeSpace) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SubscriptionSubscribeSpace) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscriptionSubscribeSpace) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SpaceId) > 0 { + i -= len(m.SpaceId) + copy(dAtA[i:], m.SpaceId) + i = encodeVarintSync(dAtA, i, uint64(len(m.SpaceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SubscriptionUnsubscribeSpace) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SubscriptionUnsubscribeSpace) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscriptionUnsubscribeSpace) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SpaceId) > 0 { + i -= len(m.SpaceId) + copy(dAtA[i:], m.SpaceId) + i = encodeVarintSync(dAtA, i, uint64(len(m.SpaceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *Sync) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1243,6 +1461,25 @@ func (m *Sync) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.TreeId) > 0 { + i -= len(m.TreeId) + copy(dAtA[i:], m.TreeId) + i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId))) + i-- + dAtA[i] = 0x22 + } + if m.TreeHeader != nil { + { + size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSync(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } if m.Message != nil { { size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) @@ -1380,34 +1617,15 @@ func (m *SyncHeadUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.TreeHeader != nil { - { - size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSync(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } if len(m.SnapshotPath) > 0 { for iNdEx := len(m.SnapshotPath) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SnapshotPath[iNdEx]) copy(dAtA[i:], m.SnapshotPath[iNdEx]) i = encodeVarintSync(dAtA, i, uint64(len(m.SnapshotPath[iNdEx]))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } } - if len(m.TreeId) > 0 { - i -= len(m.TreeId) - copy(dAtA[i:], m.TreeId) - i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId))) - i-- - dAtA[i] = 0x1a - } if len(m.Changes) > 0 { for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { { @@ -1477,34 +1695,15 @@ func (m *SyncFullRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.TreeHeader != nil { - { - size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSync(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } if len(m.SnapshotPath) > 0 { for iNdEx := len(m.SnapshotPath) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SnapshotPath[iNdEx]) copy(dAtA[i:], m.SnapshotPath[iNdEx]) i = encodeVarintSync(dAtA, i, uint64(len(m.SnapshotPath[iNdEx]))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } } - if len(m.TreeId) > 0 { - i -= len(m.TreeId) - copy(dAtA[i:], m.TreeId) - i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId))) - i-- - dAtA[i] = 0x1a - } if len(m.Changes) > 0 { for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { { @@ -1551,34 +1750,15 @@ func (m *SyncFullResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.TreeHeader != nil { - { - size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSync(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } if len(m.SnapshotPath) > 0 { for iNdEx := len(m.SnapshotPath) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SnapshotPath[iNdEx]) copy(dAtA[i:], m.SnapshotPath[iNdEx]) i = encodeVarintSync(dAtA, i, uint64(len(m.SnapshotPath[iNdEx]))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } } - if len(m.TreeId) > 0 { - i -= len(m.TreeId) - copy(dAtA[i:], m.TreeId) - i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId))) - i-- - dAtA[i] = 0x1a - } if len(m.Changes) > 0 { for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { { @@ -1734,6 +1914,49 @@ func (m *SystemError) Size() (n int) { return n } +func (m *Subscription) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SubscribeSpace != nil { + l = m.SubscribeSpace.Size() + n += 1 + l + sovSync(uint64(l)) + } + if m.UnsubscribeSpace != nil { + l = m.UnsubscribeSpace.Size() + n += 1 + l + sovSync(uint64(l)) + } + return n +} + +func (m *SubscriptionSubscribeSpace) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SpaceId) + if l > 0 { + n += 1 + l + sovSync(uint64(l)) + } + return n +} + +func (m *SubscriptionUnsubscribeSpace) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SpaceId) + if l > 0 { + n += 1 + l + sovSync(uint64(l)) + } + return n +} + func (m *Sync) Size() (n int) { if m == nil { return 0 @@ -1748,6 +1971,14 @@ func (m *Sync) Size() (n int) { l = m.Message.Size() n += 1 + l + sovSync(uint64(l)) } + if m.TreeHeader != nil { + l = m.TreeHeader.Size() + n += 1 + l + sovSync(uint64(l)) + } + l = len(m.TreeId) + if l > 0 { + n += 1 + l + sovSync(uint64(l)) + } return n } @@ -1817,20 +2048,12 @@ func (m *SyncHeadUpdate) Size() (n int) { n += 1 + l + sovSync(uint64(l)) } } - l = len(m.TreeId) - if l > 0 { - n += 1 + l + sovSync(uint64(l)) - } if len(m.SnapshotPath) > 0 { for _, s := range m.SnapshotPath { l = len(s) n += 1 + l + sovSync(uint64(l)) } } - if m.TreeHeader != nil { - l = m.TreeHeader.Size() - n += 1 + l + sovSync(uint64(l)) - } return n } @@ -1861,20 +2084,12 @@ func (m *SyncFullRequest) Size() (n int) { n += 1 + l + sovSync(uint64(l)) } } - l = len(m.TreeId) - if l > 0 { - n += 1 + l + sovSync(uint64(l)) - } if len(m.SnapshotPath) > 0 { for _, s := range m.SnapshotPath { l = len(s) n += 1 + l + sovSync(uint64(l)) } } - if m.TreeHeader != nil { - l = m.TreeHeader.Size() - n += 1 + l + sovSync(uint64(l)) - } return n } @@ -1896,20 +2111,12 @@ func (m *SyncFullResponse) Size() (n int) { n += 1 + l + sovSync(uint64(l)) } } - l = len(m.TreeId) - if l > 0 { - n += 1 + l + sovSync(uint64(l)) - } if len(m.SnapshotPath) > 0 { for _, s := range m.SnapshotPath { l = len(s) n += 1 + l + sovSync(uint64(l)) } } - if m.TreeHeader != nil { - l = m.TreeHeader.Size() - n += 1 + l + sovSync(uint64(l)) - } return n } @@ -2708,6 +2915,292 @@ func (m *SystemError) Unmarshal(dAtA []byte) error { } return nil } +func (m *Subscription) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Subscription: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Subscription: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubscribeSpace", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SubscribeSpace == nil { + m.SubscribeSpace = &SubscriptionSubscribeSpace{} + } + if err := m.SubscribeSpace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnsubscribeSpace", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UnsubscribeSpace == nil { + m.UnsubscribeSpace = &SubscriptionUnsubscribeSpace{} + } + if err := m.UnsubscribeSpace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSync(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSync + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SubscriptionSubscribeSpace) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SubscribeSpace: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SubscribeSpace: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpaceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSync(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSync + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SubscriptionUnsubscribeSpace) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UnsubscribeSpace: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnsubscribeSpace: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpaceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSync(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSync + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Sync) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2805,6 +3298,74 @@ func (m *Sync) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TreeHeader == nil { + m.TreeHeader = &treepb.TreeHeader{} + } + if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TreeId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSync(dAtA[iNdEx:]) @@ -3077,38 +3638,6 @@ func (m *SyncHeadUpdate) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TreeId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SnapshotPath", wireType) } @@ -3140,42 +3669,6 @@ func (m *SyncHeadUpdate) Unmarshal(dAtA []byte) error { } m.SnapshotPath = append(m.SnapshotPath, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TreeHeader == nil { - m.TreeHeader = &treepb.TreeHeader{} - } - if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSync(dAtA[iNdEx:]) @@ -3343,38 +3836,6 @@ func (m *SyncFullRequest) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TreeId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SnapshotPath", wireType) } @@ -3406,42 +3867,6 @@ func (m *SyncFullRequest) Unmarshal(dAtA []byte) error { } m.SnapshotPath = append(m.SnapshotPath, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TreeHeader == nil { - m.TreeHeader = &treepb.TreeHeader{} - } - if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSync(dAtA[iNdEx:]) @@ -3559,38 +3984,6 @@ func (m *SyncFullResponse) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TreeId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SnapshotPath", wireType) } @@ -3622,42 +4015,6 @@ func (m *SyncFullResponse) Unmarshal(dAtA []byte) error { } m.SnapshotPath = append(m.SnapshotPath, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TreeHeader == nil { - m.TreeHeader = &treepb.TreeHeader{} - } - if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSync(dAtA[iNdEx:])