diff --git a/client/clientspace/service.go b/client/clientspace/service.go index 98a34b16..046242cc 100644 --- a/client/clientspace/service.go +++ b/client/clientspace/service.go @@ -100,7 +100,7 @@ func (s *service) loadSpace(ctx context.Context, id string) (value ocache.Object if err != nil { return } - ns.SyncStatus().(syncstatus.SyncStatusWatcher).SetUpdateReceiver(&statusReceiver{}) + ns.SyncStatus().(syncstatus.StatusWatcher).SetUpdateReceiver(&statusReceiver{}) if err = ns.Init(ctx); err != nil { return } diff --git a/client/clientspace/statusreceiver.go b/client/clientspace/statusreceiver.go index c43ef434..50cf27bf 100644 --- a/client/clientspace/statusreceiver.go +++ b/client/clientspace/statusreceiver.go @@ -10,7 +10,7 @@ type statusReceiver struct { } func (s *statusReceiver) UpdateTree(ctx context.Context, treeId string, status syncstatus.SyncStatus) (err error) { - log.With(zap.String("treeId", treeId), zap.Bool("synced", status == syncstatus.SyncStatusSynced)). + log.With(zap.String("treeId", treeId), zap.Bool("synced", status == syncstatus.StatusSynced)). Debug("updating sync status") return nil } diff --git a/client/debug/clientdebugrpc/clientdebugrpc.go b/client/debug/clientdebugrpc/clientdebugrpc.go index 0317a81c..4507885f 100644 --- a/client/debug/clientdebugrpc/clientdebugrpc.go +++ b/client/debug/clientdebugrpc/clientdebugrpc.go @@ -17,7 +17,7 @@ import ( "storj.io/drpc" ) -const CName = "debug.clientdebugrpc" +const CName = "common.debug.clientdebugrpc" var log = logger.NewNamed(CName) diff --git a/client/debug/clientdebugrpc/rpchandler.go b/client/debug/clientdebugrpc/rpchandler.go index db3f936f..b1ea97cb 100644 --- a/client/debug/clientdebugrpc/rpchandler.go +++ b/client/debug/clientdebugrpc/rpchandler.go @@ -31,7 +31,7 @@ func (r *rpcHandler) Watch(ctx context.Context, request *clientdebugrpcproto.Wat if err != nil { return } - watcher := space.SyncStatus().(syncstatus.SyncStatusWatcher) + watcher := space.SyncStatus().(syncstatus.StatusWatcher) watcher.Watch(request.TreeId) resp = &clientdebugrpcproto.WatchResponse{} return @@ -42,7 +42,7 @@ func (r *rpcHandler) Unwatch(ctx context.Context, request *clientdebugrpcproto.U if err != nil { return } - watcher := space.SyncStatus().(syncstatus.SyncStatusWatcher) + watcher := space.SyncStatus().(syncstatus.StatusWatcher) watcher.Unwatch(request.TreeId) resp = &clientdebugrpcproto.UnwatchResponse{} return diff --git a/common/accountservice/accountservice.go b/common/accountservice/accountservice.go index e7ff7341..971de9bc 100644 --- a/common/accountservice/accountservice.go +++ b/common/accountservice/accountservice.go @@ -7,7 +7,7 @@ import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/common/config" ) -const CName = "common.account" +const CName = "common.accountservice" type Service interface { app.Component diff --git a/common/commonfile/fileblockstore/fileblockstore.go b/common/commonfile/fileblockstore/fileblockstore.go index 9cfa522e..fc974f0a 100644 --- a/common/commonfile/fileblockstore/fileblockstore.go +++ b/common/commonfile/fileblockstore/fileblockstore.go @@ -8,7 +8,7 @@ import ( "github.com/ipfs/go-cid" ) -var log = logger.NewNamed("filenode.fileblockstore") +var log = logger.NewNamed(CName) var ( ErrCIDNotFound = fileprotoerr.ErrCIDNotFound diff --git a/common/commonspace/headsync/diffsyncer.go b/common/commonspace/headsync/diffsyncer.go index ef855bf8..baec9b22 100644 --- a/common/commonspace/headsync/diffsyncer.go +++ b/common/commonspace/headsync/diffsyncer.go @@ -30,7 +30,7 @@ func newDiffSyncer( cache treegetter.TreeGetter, storage spacestorage.SpaceStorage, clientFactory spacesyncproto.ClientFactory, - syncStatus syncstatus.SyncStatusUpdater, + syncStatus syncstatus.StatusUpdater, log *zap.Logger) DiffSyncer { return &diffSyncer{ diff: diff, @@ -53,7 +53,7 @@ type diffSyncer struct { clientFactory spacesyncproto.ClientFactory log *zap.Logger deletionState deletionstate.DeletionState - syncStatus syncstatus.SyncStatusUpdater + syncStatus syncstatus.StatusUpdater } func (d *diffSyncer) Init(deletionState deletionstate.DeletionState) { diff --git a/common/commonspace/headsync/headsync.go b/common/commonspace/headsync/headsync.go index 6f07bca4..cc050bee 100644 --- a/common/commonspace/headsync/headsync.go +++ b/common/commonspace/headsync/headsync.go @@ -49,7 +49,7 @@ func NewHeadSync( storage spacestorage.SpaceStorage, confConnector nodeconf.ConfConnector, cache treegetter.TreeGetter, - syncStatus syncstatus.SyncStatusUpdater, + syncStatus syncstatus.StatusUpdater, log *zap.Logger) HeadSync { diff := ldiff.New(16, 16) diff --git a/common/commonspace/object/tree/synctree/synctree.go b/common/commonspace/object/tree/synctree/synctree.go index 5c949351..3c9e57a5 100644 --- a/common/commonspace/object/tree/synctree/synctree.go +++ b/common/commonspace/object/tree/synctree/synctree.go @@ -41,7 +41,7 @@ type syncTree struct { objecttree.ObjectTree synchandler.SyncHandler syncClient SyncClient - syncStatus syncstatus.SyncStatusUpdater + syncStatus syncstatus.StatusUpdater notifiable HeadNotifiable listener updatelistener.UpdateListener treeUsage *atomic.Int32 @@ -63,7 +63,7 @@ type CreateDeps struct { ObjectSync objectsync.ObjectSync AclList list.ACLList SpaceStorage spacestorage.SpaceStorage - SyncStatus syncstatus.SyncStatusUpdater + SyncStatus syncstatus.StatusUpdater HeadNotifiable HeadNotifiable } @@ -77,7 +77,7 @@ type BuildDeps struct { SpaceStorage spacestorage.SpaceStorage TreeStorage treestorage.TreeStorage TreeUsage *atomic.Int32 - SyncStatus syncstatus.SyncStatusUpdater + SyncStatus syncstatus.StatusUpdater } func newWrappedSyncClient( diff --git a/common/commonspace/object/tree/synctree/synctreehandler.go b/common/commonspace/object/tree/synctree/synctreehandler.go index 399ce4cb..501ef5a7 100644 --- a/common/commonspace/object/tree/synctree/synctreehandler.go +++ b/common/commonspace/object/tree/synctree/synctreehandler.go @@ -16,14 +16,14 @@ import ( type syncTreeHandler struct { objTree objecttree.ObjectTree syncClient SyncClient - syncStatus syncstatus.SyncStatusUpdater + syncStatus syncstatus.StatusUpdater handlerLock sync.Mutex queue ReceiveQueue } const maxQueueSize = 5 -func newSyncTreeHandler(objTree objecttree.ObjectTree, syncClient SyncClient, syncStatus syncstatus.SyncStatusUpdater) synchandler.SyncHandler { +func newSyncTreeHandler(objTree objecttree.ObjectTree, syncClient SyncClient, syncStatus syncstatus.StatusUpdater) synchandler.SyncHandler { return &syncTreeHandler{ objTree: objTree, syncClient: syncClient, diff --git a/common/commonspace/object/treegetter/treegetter.go b/common/commonspace/object/treegetter/treegetter.go index 2f020e86..8b3ba472 100644 --- a/common/commonspace/object/treegetter/treegetter.go +++ b/common/commonspace/object/treegetter/treegetter.go @@ -7,7 +7,7 @@ import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/object/tree/objecttree" ) -const CName = "object.treegetter" +const CName = "common.object.treegetter" type TreeGetter interface { app.ComponentRunnable diff --git a/common/commonspace/settings/settings.go b/common/commonspace/settings/settings.go index c6396192..ac35cafa 100644 --- a/common/commonspace/settings/settings.go +++ b/common/commonspace/settings/settings.go @@ -15,7 +15,7 @@ import ( "go.uber.org/zap" ) -var log = logger.NewNamed("commonspace.settings") +var log = logger.NewNamed("common.commonspace.settings") type SettingsObject interface { synctree.SyncTree diff --git a/common/commonspace/space.go b/common/commonspace/space.go index 43f99cea..f9ece8d6 100644 --- a/common/commonspace/space.go +++ b/common/commonspace/space.go @@ -81,7 +81,7 @@ type Space interface { BuildTree(ctx context.Context, id string, listener updatelistener.UpdateListener) (objecttree.ObjectTree, error) DeleteTree(ctx context.Context, id string) (err error) - SyncStatus() syncstatus.SyncStatusUpdater + SyncStatus() syncstatus.StatusUpdater Close() error } @@ -95,7 +95,7 @@ type space struct { objectSync objectsync.ObjectSync headSync headsync.HeadSync - syncStatus syncstatus.SyncStatusUpdater + syncStatus syncstatus.StatusUpdater storage spacestorage.SpaceStorage cache treegetter.TreeGetter account accountservice.Service @@ -207,7 +207,7 @@ func (s *space) HeadSync() headsync.HeadSync { return s.headSync } -func (s *space) SyncStatus() syncstatus.SyncStatusUpdater { +func (s *space) SyncStatus() syncstatus.StatusUpdater { return s.syncStatus } diff --git a/common/commonspace/spaceservice.go b/common/commonspace/spaceservice.go index 69e992b2..6a066a98 100644 --- a/common/commonspace/spaceservice.go +++ b/common/commonspace/spaceservice.go @@ -113,7 +113,7 @@ func (s *spaceService) NewSpace(ctx context.Context, id string) (Space, error) { syncStatus := syncstatus.NewNoOpSyncStatus() // this will work only for clients, not the best solution, but... if !lastConfiguration.IsResponsible(st.Id()) { - // TODO: move it to the client package and add possibility to inject SyncStatusProvider from the client + // TODO: move it to the client package and add possibility to inject StatusProvider from the client syncStatus = syncstatus.NewSyncStatusProvider(st.Id(), syncstatus.DefaultDeps(lastConfiguration, st)) } diff --git a/common/commonspace/spacestorage/mock_storage/mock_storage.go b/common/commonspace/spacestorage/mock_storage/mock_storage.go deleted file mode 100644 index b9b71ae5..00000000 --- a/common/commonspace/spacestorage/mock_storage/mock_storage.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/spacestorage (interfaces: SpaceStorageProvider,SpaceStorage) - -// Package mock_spacestorage is a generated GoMock package. -package mock_spacestorage - -import ( - reflect "reflect" - - app "github.com/anytypeio/go-anytype-infrastructure-experiments/common/app" - liststorage "github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/object/acl/liststorage" - treestorage "github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/object/tree/treestorage" - spacestorage "github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/spacestorage" - spacesyncproto "github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/spacesyncproto" - gomock "github.com/golang/mock/gomock" -) - -// MockSpaceStorageProvider is a mock of SpaceStorageProvider interface. -type MockSpaceStorageProvider struct { - ctrl *gomock.Controller - recorder *MockSpaceStorageProviderMockRecorder -} - -// MockSpaceStorageProviderMockRecorder is the mock recorder for MockSpaceStorageProvider. -type MockSpaceStorageProviderMockRecorder struct { - mock *MockSpaceStorageProvider -} - -// NewMockSpaceStorageProvider creates a new mock instance. -func NewMockSpaceStorageProvider(ctrl *gomock.Controller) *MockSpaceStorageProvider { - mock := &MockSpaceStorageProvider{ctrl: ctrl} - mock.recorder = &MockSpaceStorageProviderMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockSpaceStorageProvider) EXPECT() *MockSpaceStorageProviderMockRecorder { - return m.recorder -} - -// CreateSpaceStorage mocks base method. -func (m *MockSpaceStorageProvider) CreateSpaceStorage(arg0 spacestorage.SpaceStorageCreatePayload) (spacestorage.SpaceStorage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateSpaceStorage", arg0) - ret0, _ := ret[0].(spacestorage.SpaceStorage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CreateSpaceStorage indicates an expected call of CreateSpaceStorage. -func (mr *MockSpaceStorageProviderMockRecorder) CreateSpaceStorage(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSpaceStorage", reflect.TypeOf((*MockSpaceStorageProvider)(nil).CreateSpaceStorage), arg0) -} - -// Init mocks base method. -func (m *MockSpaceStorageProvider) Init(arg0 *app.App) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Init", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Init indicates an expected call of Init. -func (mr *MockSpaceStorageProviderMockRecorder) Init(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockSpaceStorageProvider)(nil).Init), arg0) -} - -// Name mocks base method. -func (m *MockSpaceStorageProvider) Name() string { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Name") - ret0, _ := ret[0].(string) - return ret0 -} - -// Name indicates an expected call of Name. -func (mr *MockSpaceStorageProviderMockRecorder) Name() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockSpaceStorageProvider)(nil).Name)) -} - -// SpaceStorage mocks base method. -func (m *MockSpaceStorageProvider) SpaceStorage(arg0 string) (spacestorage.SpaceStorage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SpaceStorage", arg0) - ret0, _ := ret[0].(spacestorage.SpaceStorage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// SpaceStorage indicates an expected call of SpaceStorage. -func (mr *MockSpaceStorageProviderMockRecorder) SpaceStorage(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpaceStorage", reflect.TypeOf((*MockSpaceStorageProvider)(nil).SpaceStorage), arg0) -} - -// MockSpaceStorage is a mock of SpaceStorage interface. -type MockSpaceStorage struct { - ctrl *gomock.Controller - recorder *MockSpaceStorageMockRecorder -} - -// MockSpaceStorageMockRecorder is the mock recorder for MockSpaceStorage. -type MockSpaceStorageMockRecorder struct { - mock *MockSpaceStorage -} - -// NewMockSpaceStorage creates a new mock instance. -func NewMockSpaceStorage(ctrl *gomock.Controller) *MockSpaceStorage { - mock := &MockSpaceStorage{ctrl: ctrl} - mock.recorder = &MockSpaceStorageMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockSpaceStorage) EXPECT() *MockSpaceStorageMockRecorder { - return m.recorder -} - -// ACLStorage mocks base method. -func (m *MockSpaceStorage) ACLStorage() (liststorage.ListStorage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ACLStorage") - ret0, _ := ret[0].(liststorage.ListStorage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ACLStorage indicates an expected call of ACLStorage. -func (mr *MockSpaceStorageMockRecorder) ACLStorage() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ACLStorage", reflect.TypeOf((*MockSpaceStorage)(nil).ACLStorage)) -} - -// Close mocks base method. -func (m *MockSpaceStorage) Close() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Close") - ret0, _ := ret[0].(error) - return ret0 -} - -// Close indicates an expected call of Close. -func (mr *MockSpaceStorageMockRecorder) Close() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockSpaceStorage)(nil).Close)) -} - -// CreateTreeStorage mocks base method. -func (m *MockSpaceStorage) CreateTreeStorage(arg0 treestorage.TreeStorageCreatePayload) (treestorage.TreeStorage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateTreeStorage", arg0) - ret0, _ := ret[0].(treestorage.TreeStorage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CreateTreeStorage indicates an expected call of CreateTreeStorage. -func (mr *MockSpaceStorageMockRecorder) CreateTreeStorage(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateTreeStorage", reflect.TypeOf((*MockSpaceStorage)(nil).CreateTreeStorage), arg0) -} - -// Id mocks base method. -func (m *MockSpaceStorage) Id() string { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Id") - ret0, _ := ret[0].(string) - return ret0 -} - -// Id indicates an expected call of Id. -func (mr *MockSpaceStorageMockRecorder) Id() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Id", reflect.TypeOf((*MockSpaceStorage)(nil).Id)) -} - -// SetTreeDeletedStatus mocks base method. -func (m *MockSpaceStorage) SetTreeDeletedStatus(arg0, arg1 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetTreeDeletedStatus", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetTreeDeletedStatus indicates an expected call of SetTreeDeletedStatus. -func (mr *MockSpaceStorageMockRecorder) SetTreeDeletedStatus(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTreeDeletedStatus", reflect.TypeOf((*MockSpaceStorage)(nil).SetTreeDeletedStatus), arg0, arg1) -} - -// SpaceHeader mocks base method. -func (m *MockSpaceStorage) SpaceHeader() (*spacesyncproto.RawSpaceHeaderWithId, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SpaceHeader") - ret0, _ := ret[0].(*spacesyncproto.RawSpaceHeaderWithId) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// SpaceHeader indicates an expected call of SpaceHeader. -func (mr *MockSpaceStorageMockRecorder) SpaceHeader() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpaceHeader", reflect.TypeOf((*MockSpaceStorage)(nil).SpaceHeader)) -} - -// SpaceSettingsId mocks base method. -func (m *MockSpaceStorage) SpaceSettingsId() string { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SpaceSettingsId") - ret0, _ := ret[0].(string) - return ret0 -} - -// SpaceSettingsId indicates an expected call of SpaceSettingsId. -func (mr *MockSpaceStorageMockRecorder) SpaceSettingsId() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpaceSettingsId", reflect.TypeOf((*MockSpaceStorage)(nil).SpaceSettingsId)) -} - -// StoredIds mocks base method. -func (m *MockSpaceStorage) StoredIds() ([]string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StoredIds") - ret0, _ := ret[0].([]string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StoredIds indicates an expected call of StoredIds. -func (mr *MockSpaceStorageMockRecorder) StoredIds() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoredIds", reflect.TypeOf((*MockSpaceStorage)(nil).StoredIds)) -} - -// TreeDeletedStatus mocks base method. -func (m *MockSpaceStorage) TreeDeletedStatus(arg0 string) (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "TreeDeletedStatus", arg0) - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// TreeDeletedStatus indicates an expected call of TreeDeletedStatus. -func (mr *MockSpaceStorageMockRecorder) TreeDeletedStatus(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TreeDeletedStatus", reflect.TypeOf((*MockSpaceStorage)(nil).TreeDeletedStatus), arg0) -} - -// TreeStorage mocks base method. -func (m *MockSpaceStorage) TreeStorage(arg0 string) (treestorage.TreeStorage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "TreeStorage", arg0) - ret0, _ := ret[0].(treestorage.TreeStorage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// TreeStorage indicates an expected call of TreeStorage. -func (mr *MockSpaceStorageMockRecorder) TreeStorage(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TreeStorage", reflect.TypeOf((*MockSpaceStorage)(nil).TreeStorage), arg0) -} diff --git a/common/commonspace/spacestorage/storage.go b/common/commonspace/spacestorage/storage.go index 21716aaa..843aa009 100644 --- a/common/commonspace/spacestorage/storage.go +++ b/common/commonspace/spacestorage/storage.go @@ -11,7 +11,7 @@ import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/spacesyncproto" ) -const CName = "commonspace.spacestorage" +const CName = "common.commonspace.spacestorage" var ( ErrSpaceStorageExists = errors.New("space storage exists") @@ -25,6 +25,7 @@ const ( TreeDeletedStatusDeleted = "deleted" ) +// TODO: consider moving to some file with all common interfaces etc type SpaceStorage interface { treestorage.Provider Id() string diff --git a/common/commonspace/spacesyncproto/protos/spacesync.proto b/common/commonspace/spacesyncproto/protos/spacesync.proto index a9b911db..6e9bd3eb 100644 --- a/common/commonspace/spacesyncproto/protos/spacesync.proto +++ b/common/commonspace/spacesyncproto/protos/spacesync.proto @@ -13,11 +13,11 @@ enum ErrCodes { service SpaceSync { // HeadSync compares all objects and their hashes in a space rpc HeadSync(HeadSyncRequest) returns (HeadSyncResponse); - // PushSpace sends new space to the node + // SpacePush sends new space to the node rpc SpacePush(SpacePushRequest) returns (SpacePushResponse); - // PullSpace gets space from the remote peer + // SpacePull gets space from the remote peer rpc SpacePull(SpacePullRequest) returns (SpacePullResponse); - // Stream opens object sync stream with node or client + // ObjectSyncStream opens object sync stream with node or client rpc ObjectSyncStream(stream ObjectSyncMessage) returns (stream ObjectSyncMessage); } @@ -62,24 +62,25 @@ message ObjectSyncMessage { // string peerSignature = 6; } -// PushSpaceRequest is a request to add space on a node containing only one acl record +// SpacePushRequest is a request to add space on a node containing only one acl record message SpacePushRequest { SpacePayload payload = 1; } -// PushSpaceResponse is an empty response +// SpacePushResponse is an empty response message SpacePushResponse {} -// PullSpaceRequest is a request to request a space on a node that doesn't have it +// SpacePullRequest is a request to request a space on a node that doesn't have it message SpacePullRequest { string id = 1; } -// PullSpaceResponse is a response with header and acl root +// SpacePullResponse is a response with header and acl root message SpacePullResponse { SpacePayload payload = 1; } +// SpacePayload is a payload for pushing a space message SpacePayload { RawSpaceHeaderWithId spaceHeader = 1; bytes aclPayload = 2; @@ -97,30 +98,36 @@ message SpaceHeader { bytes seed = 5; } +// RawSpaceHeader is raw header for SpaceHeader message RawSpaceHeader { bytes spaceHeader = 1; bytes signature = 2; } +// RawSpaceHeaderWithId is a marshalled RawSpaceHeader with its content id message RawSpaceHeaderWithId { bytes rawHeader = 1; string id = 2; } +// SpaceSettingsContent is a payload for a space settings object message SpaceSettingsContent { oneof value { ObjectDelete objectDelete = 1; } } +// ObjectDelete is a message containing an object id which should be deleted message ObjectDelete { string id = 1; } +// SpaceSettingsSnapshot contains all the deleted ids in a snapshot message SpaceSettingsSnapshot { repeated string deletedIds = 1; } +// SettingsData contains ObjectTree change payload message SettingsData { repeated SpaceSettingsContent content = 1; SpaceSettingsSnapshot snapshot = 2; diff --git a/common/commonspace/spacesyncproto/spacesync.pb.go b/common/commonspace/spacesyncproto/spacesync.pb.go index c38245ae..4491e775 100644 --- a/common/commonspace/spacesyncproto/spacesync.pb.go +++ b/common/commonspace/spacesyncproto/spacesync.pb.go @@ -395,7 +395,7 @@ func (m *ObjectSyncMessage) GetObjectId() string { return "" } -// PushSpaceRequest is a request to add space on a node containing only one acl record +// SpacePushRequest is a request to add space on a node containing only one acl record type SpacePushRequest struct { Payload *SpacePayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` } @@ -440,7 +440,7 @@ func (m *SpacePushRequest) GetPayload() *SpacePayload { return nil } -// PushSpaceResponse is an empty response +// SpacePushResponse is an empty response type SpacePushResponse struct { } @@ -477,7 +477,7 @@ func (m *SpacePushResponse) XXX_DiscardUnknown() { var xxx_messageInfo_SpacePushResponse proto.InternalMessageInfo -// PullSpaceRequest is a request to request a space on a node that doesn't have it +// SpacePullRequest is a request to request a space on a node that doesn't have it type SpacePullRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } @@ -522,7 +522,7 @@ func (m *SpacePullRequest) GetId() string { return "" } -// PullSpaceResponse is a response with header and acl root +// SpacePullResponse is a response with header and acl root type SpacePullResponse struct { Payload *SpacePayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` } @@ -567,6 +567,7 @@ func (m *SpacePullResponse) GetPayload() *SpacePayload { return nil } +// SpacePayload is a payload for pushing a space type SpacePayload struct { SpaceHeader *RawSpaceHeaderWithId `protobuf:"bytes,1,opt,name=spaceHeader,proto3" json:"spaceHeader,omitempty"` AclPayload []byte `protobuf:"bytes,2,opt,name=aclPayload,proto3" json:"aclPayload,omitempty"` @@ -720,6 +721,7 @@ func (m *SpaceHeader) GetSeed() []byte { return nil } +// RawSpaceHeader is raw header for SpaceHeader type RawSpaceHeader struct { SpaceHeader []byte `protobuf:"bytes,1,opt,name=spaceHeader,proto3" json:"spaceHeader,omitempty"` Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` @@ -772,6 +774,7 @@ func (m *RawSpaceHeader) GetSignature() []byte { return nil } +// RawSpaceHeaderWithId is a marshalled RawSpaceHeader with its content id type RawSpaceHeaderWithId struct { RawHeader []byte `protobuf:"bytes,1,opt,name=rawHeader,proto3" json:"rawHeader,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` @@ -824,6 +827,7 @@ func (m *RawSpaceHeaderWithId) GetId() string { return "" } +// SpaceSettingsContent is a payload for a space settings object type SpaceSettingsContent struct { // Types that are valid to be assigned to Value: // @@ -897,6 +901,7 @@ func (*SpaceSettingsContent) XXX_OneofWrappers() []interface{} { } } +// ObjectDelete is a message containing an object id which should be deleted type ObjectDelete struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } @@ -941,6 +946,7 @@ func (m *ObjectDelete) GetId() string { return "" } +// SpaceSettingsSnapshot contains all the deleted ids in a snapshot type SpaceSettingsSnapshot struct { DeletedIds []string `protobuf:"bytes,1,rep,name=deletedIds,proto3" json:"deletedIds,omitempty"` } @@ -985,6 +991,7 @@ func (m *SpaceSettingsSnapshot) GetDeletedIds() []string { return nil } +// SettingsData contains ObjectTree change payload type SettingsData struct { Content []*SpaceSettingsContent `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"` Snapshot *SpaceSettingsSnapshot `protobuf:"bytes,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"` diff --git a/common/commonspace/syncstatus/noop.go b/common/commonspace/syncstatus/noop.go index ac978e54..586b90d2 100644 --- a/common/commonspace/syncstatus/noop.go +++ b/common/commonspace/syncstatus/noop.go @@ -2,7 +2,7 @@ package syncstatus type noOpSyncStatus struct{} -func NewNoOpSyncStatus() SyncStatusUpdater { +func NewNoOpSyncStatus() StatusUpdater { return &noOpSyncStatus{} } diff --git a/common/commonspace/syncstatus/syncstatus.go b/common/commonspace/syncstatus/syncstatus.go index 5de90f1a..6a1ed555 100644 --- a/common/commonspace/syncstatus/syncstatus.go +++ b/common/commonspace/syncstatus/syncstatus.go @@ -26,7 +26,7 @@ type UpdateReceiver interface { UpdateNodeConnection(online bool) } -type SyncStatusUpdater interface { +type StatusUpdater interface { HeadsChange(treeId string, heads []string) HeadsReceive(senderId, treeId string, heads []string) @@ -38,23 +38,23 @@ type SyncStatusUpdater interface { Close() error } -type SyncStatusWatcher interface { +type StatusWatcher interface { Watch(treeId string) (err error) Unwatch(treeId string) SetUpdateReceiver(updater UpdateReceiver) } -type SyncStatusProvider interface { - SyncStatusUpdater - SyncStatusWatcher +type StatusProvider interface { + StatusUpdater + StatusWatcher } type SyncStatus int const ( - SyncStatusUnknown SyncStatus = iota - SyncStatusSynced - SyncStatusNotSynced + StatusUnknown SyncStatus = iota + StatusSynced + StatusNotSynced ) type treeHeadsEntry struct { @@ -104,7 +104,7 @@ func DefaultDeps(configuration nodeconf.Configuration, store spacestorage.SpaceS } } -func NewSyncStatusProvider(spaceId string, deps SyncStatusDeps) SyncStatusProvider { +func NewSyncStatusProvider(spaceId string, deps SyncStatusDeps) StatusProvider { return &syncStatusProvider{ spaceId: spaceId, treeHeads: map[string]treeHeadsEntry{}, @@ -143,7 +143,7 @@ func (s *syncStatusProvider) HeadsChange(treeId string, heads []string) { s.treeHeads[treeId] = treeHeadsEntry{ heads: headsCopy, stateCounter: s.stateCounter, - syncStatus: SyncStatusNotSynced, + syncStatus: StatusNotSynced, } s.stateCounter++ } @@ -193,7 +193,7 @@ func (s *syncStatusProvider) HeadsReceive(senderId, treeId string, heads []strin defer s.Unlock() curTreeHeads, ok := s.treeHeads[treeId] - if !ok || curTreeHeads.syncStatus == SyncStatusSynced { + if !ok || curTreeHeads.syncStatus == StatusSynced { return } @@ -212,7 +212,7 @@ func (s *syncStatusProvider) HeadsReceive(senderId, treeId string, heads []strin return h == "" }) if len(curTreeHeads.heads) == 0 { - curTreeHeads.syncStatus = SyncStatusSynced + curTreeHeads.syncStatus = StatusSynced } s.treeHeads[treeId] = curTreeHeads } @@ -239,7 +239,7 @@ func (s *syncStatusProvider) Watch(treeId string) (err error) { s.treeHeads[treeId] = treeHeadsEntry{ heads: heads, stateCounter: s.stateCounter, - syncStatus: SyncStatusUnknown, + syncStatus: StatusUnknown, } } @@ -285,7 +285,7 @@ func (s *syncStatusProvider) RemoveAllExcept(senderId string, differentRemoteIds } // if we didn't find our treeId in heads ids which are different from us and node if _, found := slices.BinarySearch(differentRemoteIds, treeId); !found { - entry.syncStatus = SyncStatusSynced + entry.syncStatus = StatusSynced s.treeHeads[treeId] = entry } } diff --git a/node/Makefile b/node/Makefile index c6194e7c..167abd00 100644 --- a/node/Makefile +++ b/node/Makefile @@ -10,4 +10,4 @@ test: proto: @$(eval GOGO_START := GOGO_NO_UNDERSCORE=1 GOGO_EXPORT_ONEOF_INTERFACE=1) - $(GOGO_START) protoc --gogofaster_out=:. --go-drpc_out=protolib=github.com/gogo/protobuf:. api/apiproto/protos/*.proto \ No newline at end of file + $(GOGO_START) protoc --gogofaster_out=:. --go-drpc_out=protolib=github.com/gogo/protobuf:. debug/nodedebugrpc/nodedebugrpcproto/protos/*.proto \ No newline at end of file diff --git a/node/debug/nodedebugrpc/nodedebugrpc.go b/node/debug/nodedebugrpc/nodedebugrpc.go index 17f1a6b1..a55815bb 100644 --- a/node/debug/nodedebugrpc/nodedebugrpc.go +++ b/node/debug/nodedebugrpc/nodedebugrpc.go @@ -15,7 +15,7 @@ import ( "storj.io/drpc" ) -const CName = "debug.nodedebugrpc" +const CName = "node.debug.nodedebugrpc" var log = logger.NewNamed(CName) diff --git a/node/debug/nodedebugrpc/nodedebugrpcproto/api.pb.go b/node/debug/nodedebugrpc/nodedebugrpcproto/nodedebugrpc.pb.go similarity index 82% rename from node/debug/nodedebugrpc/nodedebugrpcproto/api.pb.go rename to node/debug/nodedebugrpc/nodedebugrpcproto/nodedebugrpc.pb.go index 718de42a..b7895afd 100644 --- a/node/debug/nodedebugrpc/nodedebugrpcproto/api.pb.go +++ b/node/debug/nodedebugrpc/nodedebugrpcproto/nodedebugrpc.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: api/apiproto/protos/api.proto +// source: debug/nodedebugrpc/nodedebugrpcproto/protos/nodedebugrpc.proto package nodedebugrpcproto @@ -31,7 +31,7 @@ func (m *DumpTreeRequest) Reset() { *m = DumpTreeRequest{} } func (m *DumpTreeRequest) String() string { return proto.CompactTextString(m) } func (*DumpTreeRequest) ProtoMessage() {} func (*DumpTreeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fc31080c27db9707, []int{0} + return fileDescriptor_783a24b01ebd5381, []int{0} } func (m *DumpTreeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -82,7 +82,7 @@ func (m *DumpTreeResponse) Reset() { *m = DumpTreeResponse{} } func (m *DumpTreeResponse) String() string { return proto.CompactTextString(m) } func (*DumpTreeResponse) ProtoMessage() {} func (*DumpTreeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fc31080c27db9707, []int{1} + return fileDescriptor_783a24b01ebd5381, []int{1} } func (m *DumpTreeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -126,7 +126,7 @@ func (m *AllTreesRequest) Reset() { *m = AllTreesRequest{} } func (m *AllTreesRequest) String() string { return proto.CompactTextString(m) } func (*AllTreesRequest) ProtoMessage() {} func (*AllTreesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fc31080c27db9707, []int{2} + return fileDescriptor_783a24b01ebd5381, []int{2} } func (m *AllTreesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -171,7 +171,7 @@ func (m *Tree) Reset() { *m = Tree{} } func (m *Tree) String() string { return proto.CompactTextString(m) } func (*Tree) ProtoMessage() {} func (*Tree) Descriptor() ([]byte, []int) { - return fileDescriptor_fc31080c27db9707, []int{3} + return fileDescriptor_783a24b01ebd5381, []int{3} } func (m *Tree) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -222,7 +222,7 @@ func (m *AllTreesResponse) Reset() { *m = AllTreesResponse{} } func (m *AllTreesResponse) String() string { return proto.CompactTextString(m) } func (*AllTreesResponse) ProtoMessage() {} func (*AllTreesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fc31080c27db9707, []int{4} + return fileDescriptor_783a24b01ebd5381, []int{4} } func (m *AllTreesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -265,7 +265,7 @@ func (m *AllSpacesRequest) Reset() { *m = AllSpacesRequest{} } func (m *AllSpacesRequest) String() string { return proto.CompactTextString(m) } func (*AllSpacesRequest) ProtoMessage() {} func (*AllSpacesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fc31080c27db9707, []int{5} + return fileDescriptor_783a24b01ebd5381, []int{5} } func (m *AllSpacesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -302,7 +302,7 @@ func (m *AllSpacesResponse) Reset() { *m = AllSpacesResponse{} } func (m *AllSpacesResponse) String() string { return proto.CompactTextString(m) } func (*AllSpacesResponse) ProtoMessage() {} func (*AllSpacesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fc31080c27db9707, []int{6} + return fileDescriptor_783a24b01ebd5381, []int{6} } func (m *AllSpacesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -347,7 +347,7 @@ func (m *TreeParamsRequest) Reset() { *m = TreeParamsRequest{} } func (m *TreeParamsRequest) String() string { return proto.CompactTextString(m) } func (*TreeParamsRequest) ProtoMessage() {} func (*TreeParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fc31080c27db9707, []int{7} + return fileDescriptor_783a24b01ebd5381, []int{7} } func (m *TreeParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -399,7 +399,7 @@ func (m *TreeParamsResponse) Reset() { *m = TreeParamsResponse{} } func (m *TreeParamsResponse) String() string { return proto.CompactTextString(m) } func (*TreeParamsResponse) ProtoMessage() {} func (*TreeParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fc31080c27db9707, []int{8} + return fileDescriptor_783a24b01ebd5381, []int{8} } func (m *TreeParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -454,35 +454,38 @@ func init() { proto.RegisterType((*TreeParamsResponse)(nil), "nodeapi.TreeParamsResponse") } -func init() { proto.RegisterFile("api/apiproto/protos/api.proto", fileDescriptor_fc31080c27db9707) } +func init() { + proto.RegisterFile("debug/nodedebugrpc/nodedebugrpcproto/protos/nodedebugrpc.proto", fileDescriptor_783a24b01ebd5381) +} -var fileDescriptor_fc31080c27db9707 = []byte{ - // 394 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xcd, 0x4a, 0xf3, 0x40, - 0x14, 0x6d, 0xd2, 0xdf, 0xdc, 0xef, 0xa7, 0xed, 0x20, 0x12, 0x23, 0x86, 0x32, 0x42, 0x29, 0x28, - 0x2d, 0xd4, 0x85, 0xcb, 0xd2, 0xa2, 0x42, 0x11, 0x45, 0xa2, 0x2b, 0x77, 0xb1, 0x33, 0x60, 0xa0, - 0xe9, 0x8c, 0x99, 0xe4, 0x3d, 0x5c, 0xf9, 0x4c, 0x2e, 0xbb, 0x74, 0x29, 0xed, 0x8b, 0xc8, 0x24, - 0x93, 0x34, 0xa9, 0x05, 0x17, 0x6e, 0x92, 0x39, 0x73, 0x6e, 0xce, 0x3d, 0x73, 0xcf, 0x04, 0x8e, - 0x5c, 0xee, 0x0d, 0x5c, 0xee, 0xf1, 0x80, 0x85, 0x6c, 0x10, 0x3f, 0x85, 0xc4, 0xfd, 0x78, 0x89, - 0xea, 0x0b, 0x46, 0xa8, 0xcb, 0x3d, 0x7c, 0x0d, 0xcd, 0x8b, 0xc8, 0xe7, 0x0f, 0x01, 0xa5, 0x0e, - 0x7d, 0x89, 0xa8, 0x08, 0x91, 0x09, 0x75, 0xc1, 0xdd, 0x19, 0x9d, 0x12, 0x53, 0xeb, 0x68, 0x3d, - 0xc3, 0x49, 0x21, 0xb2, 0x01, 0x08, 0x9b, 0x45, 0x3e, 0x5d, 0x84, 0x53, 0x62, 0xea, 0x31, 0x99, - 0xdb, 0xc1, 0x5d, 0x68, 0x6d, 0xc4, 0x04, 0x67, 0x0b, 0x41, 0x11, 0x82, 0x0a, 0x89, 0x7c, 0xae, - 0xa4, 0xe2, 0x35, 0x3e, 0x81, 0xe6, 0x78, 0x3e, 0x97, 0x65, 0xe2, 0xc7, 0xa6, 0xf8, 0x14, 0x2a, - 0xb2, 0x12, 0xfd, 0x07, 0xdd, 0x4b, 0x49, 0xdd, 0x23, 0x68, 0x0f, 0xaa, 0xcf, 0xd4, 0x25, 0xc2, - 0xd4, 0x3b, 0xe5, 0x9e, 0xe1, 0x24, 0x00, 0x9f, 0x43, 0x6b, 0x23, 0xad, 0x2c, 0x1c, 0x43, 0x35, - 0x94, 0x1b, 0xa6, 0xd6, 0x29, 0xf7, 0xfe, 0x0c, 0xff, 0xf5, 0xd5, 0xe1, 0xfb, 0xb1, 0xd1, 0x84, - 0xc3, 0x28, 0xfe, 0xf0, 0x5e, 0x36, 0x4d, 0x4d, 0xe1, 0x01, 0xb4, 0x73, 0x7b, 0x4a, 0xcd, 0x82, - 0x86, 0xb2, 0x96, 0x08, 0x1a, 0x4e, 0x86, 0xf1, 0x0d, 0xb4, 0xa5, 0xe6, 0x9d, 0x1b, 0xb8, 0xbe, - 0xf8, 0xfd, 0x3c, 0xaf, 0x00, 0xe5, 0xe5, 0x94, 0x81, 0x7d, 0xa8, 0x05, 0x8c, 0x85, 0x99, 0x9c, - 0x42, 0xb2, 0x8f, 0x9c, 0xc1, 0x34, 0x1b, 0x49, 0x0a, 0x87, 0x6f, 0x3a, 0xd4, 0x6f, 0x19, 0xa1, - 0x63, 0xee, 0xa1, 0x11, 0x34, 0xd2, 0x8c, 0x90, 0x99, 0x4d, 0x62, 0xeb, 0x0e, 0x58, 0x07, 0x3b, - 0x18, 0xd5, 0xfe, 0x12, 0x60, 0x63, 0x0a, 0x59, 0x85, 0x61, 0x16, 0x0e, 0x6e, 0x1d, 0xee, 0xe4, - 0x94, 0xcc, 0x08, 0x1a, 0x69, 0x50, 0x39, 0x1f, 0x5b, 0xd7, 0x22, 0xe7, 0xe3, 0x5b, 0xaa, 0x13, - 0x30, 0xb2, 0x70, 0x50, 0xa1, 0xae, 0x10, 0xa2, 0x65, 0xed, 0xa2, 0x12, 0x8d, 0x49, 0xf7, 0x7d, - 0x65, 0x6b, 0xcb, 0x95, 0xad, 0x7d, 0xae, 0x6c, 0xed, 0x75, 0x6d, 0x97, 0x96, 0x6b, 0xbb, 0xf4, - 0xb1, 0xb6, 0x4b, 0x8f, 0x7f, 0xf3, 0xff, 0xcf, 0x53, 0x2d, 0x7e, 0x9d, 0x7d, 0x05, 0x00, 0x00, - 0xff, 0xff, 0xb6, 0x98, 0xe5, 0x1d, 0x56, 0x03, 0x00, 0x00, +var fileDescriptor_783a24b01ebd5381 = []byte{ + // 406 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xcf, 0x6b, 0xdb, 0x30, + 0x18, 0x8d, 0x9d, 0x9f, 0xfe, 0xc6, 0x96, 0x44, 0x8c, 0xe1, 0x79, 0x60, 0x82, 0x36, 0x46, 0x60, + 0x23, 0x81, 0xec, 0xb0, 0x5b, 0x42, 0xc2, 0x36, 0x08, 0xa3, 0xa5, 0xb8, 0x3d, 0xf5, 0xe6, 0x44, + 0xa2, 0x35, 0xc4, 0x91, 0x6a, 0xd9, 0xff, 0x47, 0x4f, 0xfd, 0x9b, 0x7a, 0xcc, 0xb1, 0xc7, 0x92, + 0xfc, 0x23, 0x45, 0xb2, 0xec, 0xd8, 0x69, 0xa0, 0x85, 0x5e, 0x6c, 0xbd, 0xef, 0xc9, 0xef, 0x7b, + 0xfa, 0x9e, 0x0c, 0x63, 0x42, 0x17, 0xc9, 0xd5, 0x70, 0xcd, 0x08, 0x55, 0xab, 0x88, 0x2f, 0x4b, + 0x80, 0x47, 0x2c, 0x66, 0x43, 0xf5, 0x14, 0x25, 0x62, 0xa0, 0x6a, 0xa8, 0x29, 0x6b, 0x3e, 0x0f, + 0xf0, 0x7f, 0x68, 0xff, 0x49, 0x42, 0x7e, 0x11, 0x51, 0xea, 0xd1, 0x9b, 0x84, 0x8a, 0x18, 0xd9, + 0xd0, 0x14, 0xdc, 0x5f, 0xd2, 0x39, 0xb1, 0x8d, 0x9e, 0xd1, 0xb7, 0xbc, 0x0c, 0x22, 0x17, 0x80, + 0xb0, 0x65, 0x12, 0xd2, 0x75, 0x3c, 0x27, 0xb6, 0xa9, 0xc8, 0x42, 0x05, 0x7f, 0x87, 0xce, 0x5e, + 0x4c, 0x70, 0xb6, 0x16, 0x14, 0x21, 0xa8, 0x91, 0x24, 0xe4, 0x5a, 0x4a, 0xad, 0xf1, 0x0f, 0x68, + 0x4f, 0x57, 0x2b, 0xb9, 0x4d, 0xbc, 0xd8, 0x14, 0xff, 0x84, 0x9a, 0xdc, 0x89, 0x3e, 0x80, 0x19, + 0x64, 0xa4, 0x19, 0x10, 0xf4, 0x11, 0xea, 0xd7, 0xd4, 0x27, 0xc2, 0x36, 0x7b, 0xd5, 0xbe, 0xe5, + 0xa5, 0x00, 0xff, 0x86, 0xce, 0x5e, 0x5a, 0x5b, 0xf8, 0x0a, 0xf5, 0x58, 0x16, 0x6c, 0xa3, 0x57, + 0xed, 0xbf, 0x1b, 0xbd, 0x1f, 0xe8, 0xc3, 0x0f, 0x94, 0xd1, 0x94, 0xc3, 0x48, 0x7d, 0x78, 0x2e, + 0x9b, 0x66, 0xa6, 0xf0, 0x10, 0xba, 0x85, 0x9a, 0x56, 0x73, 0xa0, 0xa5, 0xad, 0xa5, 0x82, 0x96, + 0x97, 0x63, 0x7c, 0x02, 0x5d, 0xa9, 0x79, 0xe6, 0x47, 0x7e, 0x28, 0xde, 0x3e, 0xcf, 0x7f, 0x80, + 0x8a, 0x72, 0xda, 0xc0, 0x27, 0x68, 0x44, 0x8c, 0xc5, 0xb9, 0x9c, 0x46, 0xb2, 0x8f, 0x9c, 0xc1, + 0x3c, 0x1f, 0x49, 0x06, 0x47, 0x77, 0x26, 0x34, 0x4f, 0x19, 0xa1, 0x53, 0x1e, 0xa0, 0x09, 0xb4, + 0xb2, 0x8c, 0x90, 0x9d, 0x4f, 0xe2, 0xe0, 0x0e, 0x38, 0x9f, 0x8f, 0x30, 0xba, 0xfd, 0x5f, 0x80, + 0xbd, 0x29, 0xe4, 0x94, 0x86, 0x59, 0x3a, 0xb8, 0xf3, 0xe5, 0x28, 0xa7, 0x65, 0x26, 0xd0, 0xca, + 0x82, 0x2a, 0xf8, 0x38, 0xb8, 0x16, 0x05, 0x1f, 0xcf, 0x52, 0x9d, 0x81, 0x95, 0x87, 0x83, 0x4a, + 0xfb, 0x4a, 0x21, 0x3a, 0xce, 0x31, 0x2a, 0xd5, 0x98, 0x8d, 0xef, 0xb7, 0xae, 0xb1, 0xd9, 0xba, + 0xc6, 0xe3, 0xd6, 0x35, 0x6e, 0x77, 0x6e, 0x65, 0xb3, 0x73, 0x2b, 0x0f, 0x3b, 0xb7, 0x72, 0xf9, + 0xed, 0x35, 0x3f, 0xd8, 0xa2, 0xa1, 0x5e, 0xbf, 0x9e, 0x02, 0x00, 0x00, 0xff, 0xff, 0xac, 0x0e, + 0xb9, 0x90, 0x8f, 0x03, 0x00, 0x00, } func (m *DumpTreeRequest) Marshal() (dAtA []byte, err error) { @@ -508,14 +511,14 @@ func (m *DumpTreeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.DocumentId) > 0 { i -= len(m.DocumentId) copy(dAtA[i:], m.DocumentId) - i = encodeVarintApi(dAtA, i, uint64(len(m.DocumentId))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.DocumentId))) i-- dAtA[i] = 0x12 } if len(m.SpaceId) > 0 { i -= len(m.SpaceId) copy(dAtA[i:], m.SpaceId) - i = encodeVarintApi(dAtA, i, uint64(len(m.SpaceId))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.SpaceId))) i-- dAtA[i] = 0xa } @@ -545,7 +548,7 @@ func (m *DumpTreeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Dump) > 0 { i -= len(m.Dump) copy(dAtA[i:], m.Dump) - i = encodeVarintApi(dAtA, i, uint64(len(m.Dump))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.Dump))) i-- dAtA[i] = 0xa } @@ -575,7 +578,7 @@ func (m *AllTreesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.SpaceId) > 0 { i -= len(m.SpaceId) copy(dAtA[i:], m.SpaceId) - i = encodeVarintApi(dAtA, i, uint64(len(m.SpaceId))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.SpaceId))) i-- dAtA[i] = 0xa } @@ -606,7 +609,7 @@ func (m *Tree) MarshalToSizedBuffer(dAtA []byte) (int, error) { for iNdEx := len(m.Heads) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Heads[iNdEx]) copy(dAtA[i:], m.Heads[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.Heads[iNdEx]))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.Heads[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -614,7 +617,7 @@ func (m *Tree) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -649,7 +652,7 @@ func (m *AllTreesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -705,7 +708,7 @@ func (m *AllSpacesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { for iNdEx := len(m.SpaceIds) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SpaceIds[iNdEx]) copy(dAtA[i:], m.SpaceIds[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.SpaceIds[iNdEx]))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.SpaceIds[iNdEx]))) i-- dAtA[i] = 0xa } @@ -736,14 +739,14 @@ func (m *TreeParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.DocumentId) > 0 { i -= len(m.DocumentId) copy(dAtA[i:], m.DocumentId) - i = encodeVarintApi(dAtA, i, uint64(len(m.DocumentId))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.DocumentId))) i-- dAtA[i] = 0x12 } if len(m.SpaceId) > 0 { i -= len(m.SpaceId) copy(dAtA[i:], m.SpaceId) - i = encodeVarintApi(dAtA, i, uint64(len(m.SpaceId))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.SpaceId))) i-- dAtA[i] = 0xa } @@ -774,7 +777,7 @@ func (m *TreeParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { for iNdEx := len(m.HeadIds) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.HeadIds[iNdEx]) copy(dAtA[i:], m.HeadIds[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.HeadIds[iNdEx]))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.HeadIds[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -782,15 +785,15 @@ func (m *TreeParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.RootId) > 0 { i -= len(m.RootId) copy(dAtA[i:], m.RootId) - i = encodeVarintApi(dAtA, i, uint64(len(m.RootId))) + i = encodeVarintNodedebugrpc(dAtA, i, uint64(len(m.RootId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarintApi(dAtA []byte, offset int, v uint64) int { - offset -= sovApi(v) +func encodeVarintNodedebugrpc(dAtA []byte, offset int, v uint64) int { + offset -= sovNodedebugrpc(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -808,11 +811,11 @@ func (m *DumpTreeRequest) Size() (n int) { _ = l l = len(m.SpaceId) if l > 0 { - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } l = len(m.DocumentId) if l > 0 { - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } return n } @@ -825,7 +828,7 @@ func (m *DumpTreeResponse) Size() (n int) { _ = l l = len(m.Dump) if l > 0 { - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } return n } @@ -838,7 +841,7 @@ func (m *AllTreesRequest) Size() (n int) { _ = l l = len(m.SpaceId) if l > 0 { - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } return n } @@ -851,12 +854,12 @@ func (m *Tree) Size() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } if len(m.Heads) > 0 { for _, s := range m.Heads { l = len(s) - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } } return n @@ -871,7 +874,7 @@ func (m *AllTreesResponse) Size() (n int) { if len(m.Trees) > 0 { for _, e := range m.Trees { l = e.Size() - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } } return n @@ -895,7 +898,7 @@ func (m *AllSpacesResponse) Size() (n int) { if len(m.SpaceIds) > 0 { for _, s := range m.SpaceIds { l = len(s) - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } } return n @@ -909,11 +912,11 @@ func (m *TreeParamsRequest) Size() (n int) { _ = l l = len(m.SpaceId) if l > 0 { - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } l = len(m.DocumentId) if l > 0 { - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } return n } @@ -926,22 +929,22 @@ func (m *TreeParamsResponse) Size() (n int) { _ = l l = len(m.RootId) if l > 0 { - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } if len(m.HeadIds) > 0 { for _, s := range m.HeadIds { l = len(s) - n += 1 + l + sovApi(uint64(l)) + n += 1 + l + sovNodedebugrpc(uint64(l)) } } return n } -func sovApi(x uint64) (n int) { +func sovNodedebugrpc(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozApi(x uint64) (n int) { - return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func sozNodedebugrpc(x uint64) (n int) { + return sovNodedebugrpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *DumpTreeRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -951,7 +954,7 @@ func (m *DumpTreeRequest) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -979,7 +982,7 @@ func (m *DumpTreeRequest) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -993,11 +996,11 @@ func (m *DumpTreeRequest) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1011,7 +1014,7 @@ func (m *DumpTreeRequest) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1025,11 +1028,11 @@ func (m *DumpTreeRequest) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1038,12 +1041,12 @@ func (m *DumpTreeRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) + skippy, err := skipNodedebugrpc(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1065,7 +1068,7 @@ func (m *DumpTreeResponse) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1093,7 +1096,7 @@ func (m *DumpTreeResponse) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1107,11 +1110,11 @@ func (m *DumpTreeResponse) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1120,12 +1123,12 @@ func (m *DumpTreeResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) + skippy, err := skipNodedebugrpc(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1147,7 +1150,7 @@ func (m *AllTreesRequest) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1175,7 +1178,7 @@ func (m *AllTreesRequest) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1189,11 +1192,11 @@ func (m *AllTreesRequest) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1202,12 +1205,12 @@ func (m *AllTreesRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) + skippy, err := skipNodedebugrpc(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1229,7 +1232,7 @@ func (m *Tree) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1257,7 +1260,7 @@ func (m *Tree) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1271,11 +1274,11 @@ func (m *Tree) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1289,7 +1292,7 @@ func (m *Tree) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1303,11 +1306,11 @@ func (m *Tree) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1316,12 +1319,12 @@ func (m *Tree) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) + skippy, err := skipNodedebugrpc(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1343,7 +1346,7 @@ func (m *AllTreesResponse) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1371,7 +1374,7 @@ func (m *AllTreesResponse) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1384,11 +1387,11 @@ func (m *AllTreesResponse) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1400,12 +1403,12 @@ func (m *AllTreesResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) + skippy, err := skipNodedebugrpc(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1427,7 +1430,7 @@ func (m *AllSpacesRequest) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1450,12 +1453,12 @@ func (m *AllSpacesRequest) Unmarshal(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) + skippy, err := skipNodedebugrpc(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1477,7 +1480,7 @@ func (m *AllSpacesResponse) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1505,7 +1508,7 @@ func (m *AllSpacesResponse) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1519,11 +1522,11 @@ func (m *AllSpacesResponse) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1532,12 +1535,12 @@ func (m *AllSpacesResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) + skippy, err := skipNodedebugrpc(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1559,7 +1562,7 @@ func (m *TreeParamsRequest) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1587,7 +1590,7 @@ func (m *TreeParamsRequest) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1601,11 +1604,11 @@ func (m *TreeParamsRequest) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1619,7 +1622,7 @@ func (m *TreeParamsRequest) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1633,11 +1636,11 @@ func (m *TreeParamsRequest) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1646,12 +1649,12 @@ func (m *TreeParamsRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) + skippy, err := skipNodedebugrpc(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1673,7 +1676,7 @@ func (m *TreeParamsResponse) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1701,7 +1704,7 @@ func (m *TreeParamsResponse) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1715,11 +1718,11 @@ func (m *TreeParamsResponse) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1733,7 +1736,7 @@ func (m *TreeParamsResponse) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApi + return ErrIntOverflowNodedebugrpc } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1747,11 +1750,11 @@ func (m *TreeParamsResponse) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if postIndex > l { return io.ErrUnexpectedEOF @@ -1760,12 +1763,12 @@ func (m *TreeParamsResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) + skippy, err := skipNodedebugrpc(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi + return ErrInvalidLengthNodedebugrpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1779,7 +1782,7 @@ func (m *TreeParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func skipApi(dAtA []byte) (n int, err error) { +func skipNodedebugrpc(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -1787,7 +1790,7 @@ func skipApi(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowApi + return 0, ErrIntOverflowNodedebugrpc } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1804,7 +1807,7 @@ func skipApi(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowApi + return 0, ErrIntOverflowNodedebugrpc } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1820,7 +1823,7 @@ func skipApi(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowApi + return 0, ErrIntOverflowNodedebugrpc } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1833,14 +1836,14 @@ func skipApi(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthApi + return 0, ErrInvalidLengthNodedebugrpc } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupApi + return 0, ErrUnexpectedEndOfGroupNodedebugrpc } depth-- case 5: @@ -1849,7 +1852,7 @@ func skipApi(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthApi + return 0, ErrInvalidLengthNodedebugrpc } if depth == 0 { return iNdEx, nil @@ -1859,7 +1862,7 @@ func skipApi(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthNodedebugrpc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNodedebugrpc = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNodedebugrpc = fmt.Errorf("proto: unexpected end of group") ) diff --git a/node/debug/nodedebugrpc/nodedebugrpcproto/api_drpc.pb.go b/node/debug/nodedebugrpc/nodedebugrpcproto/nodedebugrpc_drpc.pb.go similarity index 74% rename from node/debug/nodedebugrpc/nodedebugrpcproto/api_drpc.pb.go rename to node/debug/nodedebugrpc/nodedebugrpcproto/nodedebugrpc_drpc.pb.go index f13b466b..4981b9fd 100644 --- a/node/debug/nodedebugrpc/nodedebugrpcproto/api_drpc.pb.go +++ b/node/debug/nodedebugrpc/nodedebugrpcproto/nodedebugrpc_drpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-drpc. DO NOT EDIT. // protoc-gen-go-drpc version: v0.0.32 -// source: api/apiproto/protos/api.proto +// source: debug/nodedebugrpc/nodedebugrpcproto/protos/nodedebugrpc.proto package nodedebugrpcproto @@ -14,17 +14,17 @@ import ( drpcerr "storj.io/drpc/drpcerr" ) -type drpcEncoding_File_api_apiproto_protos_api_proto struct{} +type drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto struct{} -func (drpcEncoding_File_api_apiproto_protos_api_proto) Marshal(msg drpc.Message) ([]byte, error) { +func (drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto) Marshal(msg drpc.Message) ([]byte, error) { return proto.Marshal(msg.(proto.Message)) } -func (drpcEncoding_File_api_apiproto_protos_api_proto) Unmarshal(buf []byte, msg drpc.Message) error { +func (drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto) Unmarshal(buf []byte, msg drpc.Message) error { return proto.Unmarshal(buf, msg.(proto.Message)) } -func (drpcEncoding_File_api_apiproto_protos_api_proto) JSONMarshal(msg drpc.Message) ([]byte, error) { +func (drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto) JSONMarshal(msg drpc.Message) ([]byte, error) { var buf bytes.Buffer err := new(jsonpb.Marshaler).Marshal(&buf, msg.(proto.Message)) if err != nil { @@ -33,7 +33,7 @@ func (drpcEncoding_File_api_apiproto_protos_api_proto) JSONMarshal(msg drpc.Mess return buf.Bytes(), nil } -func (drpcEncoding_File_api_apiproto_protos_api_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error { +func (drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error { return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message)) } @@ -58,7 +58,7 @@ func (c *drpcNodeApiClient) DRPCConn() drpc.Conn { return c.cc } func (c *drpcNodeApiClient) DumpTree(ctx context.Context, in *DumpTreeRequest) (*DumpTreeResponse, error) { out := new(DumpTreeResponse) - err := c.cc.Invoke(ctx, "/nodeapi.NodeApi/DumpTree", drpcEncoding_File_api_apiproto_protos_api_proto{}, in, out) + err := c.cc.Invoke(ctx, "/nodeapi.NodeApi/DumpTree", drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}, in, out) if err != nil { return nil, err } @@ -67,7 +67,7 @@ func (c *drpcNodeApiClient) DumpTree(ctx context.Context, in *DumpTreeRequest) ( func (c *drpcNodeApiClient) TreeParams(ctx context.Context, in *TreeParamsRequest) (*TreeParamsResponse, error) { out := new(TreeParamsResponse) - err := c.cc.Invoke(ctx, "/nodeapi.NodeApi/TreeParams", drpcEncoding_File_api_apiproto_protos_api_proto{}, in, out) + err := c.cc.Invoke(ctx, "/nodeapi.NodeApi/TreeParams", drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}, in, out) if err != nil { return nil, err } @@ -76,7 +76,7 @@ func (c *drpcNodeApiClient) TreeParams(ctx context.Context, in *TreeParamsReques func (c *drpcNodeApiClient) AllTrees(ctx context.Context, in *AllTreesRequest) (*AllTreesResponse, error) { out := new(AllTreesResponse) - err := c.cc.Invoke(ctx, "/nodeapi.NodeApi/AllTrees", drpcEncoding_File_api_apiproto_protos_api_proto{}, in, out) + err := c.cc.Invoke(ctx, "/nodeapi.NodeApi/AllTrees", drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}, in, out) if err != nil { return nil, err } @@ -85,7 +85,7 @@ func (c *drpcNodeApiClient) AllTrees(ctx context.Context, in *AllTreesRequest) ( func (c *drpcNodeApiClient) AllSpaces(ctx context.Context, in *AllSpacesRequest) (*AllSpacesResponse, error) { out := new(AllSpacesResponse) - err := c.cc.Invoke(ctx, "/nodeapi.NodeApi/AllSpaces", drpcEncoding_File_api_apiproto_protos_api_proto{}, in, out) + err := c.cc.Invoke(ctx, "/nodeapi.NodeApi/AllSpaces", drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}, in, out) if err != nil { return nil, err } @@ -124,7 +124,7 @@ func (DRPCNodeApiDescription) NumMethods() int { return 4 } func (DRPCNodeApiDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) { switch n { case 0: - return "/nodeapi.NodeApi/DumpTree", drpcEncoding_File_api_apiproto_protos_api_proto{}, + return "/nodeapi.NodeApi/DumpTree", drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCNodeApiServer). DumpTree( @@ -133,7 +133,7 @@ func (DRPCNodeApiDescription) Method(n int) (string, drpc.Encoding, drpc.Receive ) }, DRPCNodeApiServer.DumpTree, true case 1: - return "/nodeapi.NodeApi/TreeParams", drpcEncoding_File_api_apiproto_protos_api_proto{}, + return "/nodeapi.NodeApi/TreeParams", drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCNodeApiServer). TreeParams( @@ -142,7 +142,7 @@ func (DRPCNodeApiDescription) Method(n int) (string, drpc.Encoding, drpc.Receive ) }, DRPCNodeApiServer.TreeParams, true case 2: - return "/nodeapi.NodeApi/AllTrees", drpcEncoding_File_api_apiproto_protos_api_proto{}, + return "/nodeapi.NodeApi/AllTrees", drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCNodeApiServer). AllTrees( @@ -151,7 +151,7 @@ func (DRPCNodeApiDescription) Method(n int) (string, drpc.Encoding, drpc.Receive ) }, DRPCNodeApiServer.AllTrees, true case 3: - return "/nodeapi.NodeApi/AllSpaces", drpcEncoding_File_api_apiproto_protos_api_proto{}, + return "/nodeapi.NodeApi/AllSpaces", drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCNodeApiServer). AllSpaces( @@ -178,7 +178,7 @@ type drpcNodeApi_DumpTreeStream struct { } func (x *drpcNodeApi_DumpTreeStream) SendAndClose(m *DumpTreeResponse) error { - if err := x.MsgSend(m, drpcEncoding_File_api_apiproto_protos_api_proto{}); err != nil { + if err := x.MsgSend(m, drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}); err != nil { return err } return x.CloseSend() @@ -194,7 +194,7 @@ type drpcNodeApi_TreeParamsStream struct { } func (x *drpcNodeApi_TreeParamsStream) SendAndClose(m *TreeParamsResponse) error { - if err := x.MsgSend(m, drpcEncoding_File_api_apiproto_protos_api_proto{}); err != nil { + if err := x.MsgSend(m, drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}); err != nil { return err } return x.CloseSend() @@ -210,7 +210,7 @@ type drpcNodeApi_AllTreesStream struct { } func (x *drpcNodeApi_AllTreesStream) SendAndClose(m *AllTreesResponse) error { - if err := x.MsgSend(m, drpcEncoding_File_api_apiproto_protos_api_proto{}); err != nil { + if err := x.MsgSend(m, drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}); err != nil { return err } return x.CloseSend() @@ -226,7 +226,7 @@ type drpcNodeApi_AllSpacesStream struct { } func (x *drpcNodeApi_AllSpacesStream) SendAndClose(m *AllSpacesResponse) error { - if err := x.MsgSend(m, drpcEncoding_File_api_apiproto_protos_api_proto{}); err != nil { + if err := x.MsgSend(m, drpcEncoding_File_debug_nodedebugrpc_nodedebugrpcproto_protos_nodedebugrpc_proto{}); err != nil { return err } return x.CloseSend() diff --git a/node/debug/nodedebugrpc/nodedebugrpcproto/protos/api.proto b/node/debug/nodedebugrpc/nodedebugrpcproto/protos/nodedebugrpc.proto similarity index 93% rename from node/debug/nodedebugrpc/nodedebugrpcproto/protos/api.proto rename to node/debug/nodedebugrpc/nodedebugrpcproto/protos/nodedebugrpc.proto index 4ed13b20..0425bc61 100644 --- a/node/debug/nodedebugrpc/nodedebugrpcproto/protos/api.proto +++ b/node/debug/nodedebugrpc/nodedebugrpcproto/protos/nodedebugrpc.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package nodeapi; -option go_package = "api/apiproto"; +option go_package = "debug/nodedebugrpc/nodedebugrpcproto"; service NodeApi { rpc DumpTree(DumpTreeRequest) returns(DumpTreeResponse); diff --git a/node/nodespace/rpchandler.go b/node/nodespace/rpchandler.go index 0e9d7da4..f82f6d79 100644 --- a/node/nodespace/rpchandler.go +++ b/node/nodespace/rpchandler.go @@ -10,7 +10,7 @@ type rpcHandler struct { s *service } -func (r *rpcHandler) PullSpace(ctx context.Context, request *spacesyncproto.SpacePullRequest) (resp *spacesyncproto.SpacePullResponse, err error) { +func (r *rpcHandler) SpacePull(ctx context.Context, request *spacesyncproto.SpacePullRequest) (resp *spacesyncproto.SpacePullResponse, err error) { sp, err := r.s.GetSpace(ctx, request.Id) if err != nil { if err != spacesyncproto.ErrSpaceMissing { @@ -37,7 +37,7 @@ func (r *rpcHandler) PullSpace(ctx context.Context, request *spacesyncproto.Spac return } -func (r *rpcHandler) PushSpace(ctx context.Context, req *spacesyncproto.SpacePushRequest) (resp *spacesyncproto.SpacePushResponse, err error) { +func (r *rpcHandler) SpacePush(ctx context.Context, req *spacesyncproto.SpacePushRequest) (resp *spacesyncproto.SpacePushResponse, err error) { description := commonspace.SpaceDescription{ SpaceHeader: req.Payload.SpaceHeader, AclId: req.Payload.AclPayloadId, @@ -62,7 +62,7 @@ func (r *rpcHandler) HeadSync(ctx context.Context, req *spacesyncproto.HeadSyncR return sp.SpaceSyncRpc().HeadSync(ctx, req) } -func (r *rpcHandler) Stream(stream spacesyncproto.DRPCSpaceSync_ObjectSyncStreamStream) error { +func (r *rpcHandler) ObjectSyncStream(stream spacesyncproto.DRPCSpaceSync_ObjectSyncStreamStream) error { msg, err := stream.Recv() if err != nil { return err diff --git a/node/nodespace/service.go b/node/nodespace/service.go index 1d07efbb..26ae28ca 100644 --- a/node/nodespace/service.go +++ b/node/nodespace/service.go @@ -43,7 +43,7 @@ func (s *service) Init(a *app.App) (err error) { ocache.WithGCPeriod(time.Minute), ocache.WithTTL(time.Duration(s.conf.GCTTL)*time.Second), ) - return spacesyncproto.DRPCRegisterSpace(a.MustComponent(server.CName).(server.DRPCServer), &rpcHandler{s}) + return spacesyncproto.DRPCRegisterSpaceSync(a.MustComponent(server.CName).(server.DRPCServer), &rpcHandler{s}) } func (s *service) Name() (name string) { diff --git a/util/cmd/debug/commands/client/service.go b/util/cmd/debug/commands/client/service.go index f370e0e0..b5f57eac 100644 --- a/util/cmd/debug/commands/client/service.go +++ b/util/cmd/debug/commands/client/service.go @@ -8,7 +8,7 @@ import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/util/cmd/debug/drpcclient" ) -const CName = "commands.client" +const CName = "debug.commands.client" var log = logger.NewNamed(CName) diff --git a/util/cmd/debug/commands/node/service.go b/util/cmd/debug/commands/node/service.go index 32b81fcb..0d83d38c 100644 --- a/util/cmd/debug/commands/node/service.go +++ b/util/cmd/debug/commands/node/service.go @@ -8,7 +8,7 @@ import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/util/cmd/debug/drpcclient" ) -const CName = "commands.node" +const CName = "debug.commands.node" var log = logger.NewNamed(CName)