diff --git a/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.h b/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.h index b4bd7603b..3628fbbc2 100644 --- a/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.h +++ b/native/cpp/CommonCpp/grpc/_generated/backup.grpc.pb.h @@ -1,605 +1,618 @@ // @generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: backup.proto #ifndef GRPC_backup_2eproto__INCLUDED #define GRPC_backup_2eproto__INCLUDED #include "backup.pb.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace backup { +// * +// API - description +// CreateNewBackup - This method is called when we want to create a new backup. +// We send a new backup key encrypted with the user's password and also the +// new compaction. New logs that will be sent from now on will be assigned to +// this the compaction of this backup. +// SendLog - User sends a new log to the backup service. The log is being +// assigned to the latest(or desired) backup's compaction item. +// RecoverBackupKey - Pulls data necessary for regenerating the backup key +// on the client-side for the latest(or desired) backup +// PullBackup - Fetches compaction + all logs assigned to it for the +// specified backup(default is the last backup) +// class BackupService final { public: static constexpr char const* service_full_name() { return "backup.BackupService"; } class StubInterface { public: virtual ~StubInterface() {} std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>> CreateNewBackup(::grpc::ClientContext* context) { return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>>(CreateNewBackupRaw(context)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>> AsyncCreateNewBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>>(AsyncCreateNewBackupRaw(context, cq, tag)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>> PrepareAsyncCreateNewBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>>(PrepareAsyncCreateNewBackupRaw(context, cq)); } std::unique_ptr< ::grpc::ClientWriterInterface< ::backup::SendLogRequest>> SendLog(::grpc::ClientContext* context, ::google::protobuf::Empty* response) { return std::unique_ptr< ::grpc::ClientWriterInterface< ::backup::SendLogRequest>>(SendLogRaw(context, response)); } std::unique_ptr< ::grpc::ClientAsyncWriterInterface< ::backup::SendLogRequest>> AsyncSendLog(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::CompletionQueue* cq, void* tag) { return std::unique_ptr< ::grpc::ClientAsyncWriterInterface< ::backup::SendLogRequest>>(AsyncSendLogRaw(context, response, cq, tag)); } std::unique_ptr< ::grpc::ClientAsyncWriterInterface< ::backup::SendLogRequest>> PrepareAsyncSendLog(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncWriterInterface< ::backup::SendLogRequest>>(PrepareAsyncSendLogRaw(context, response, cq)); } std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>> RecoverBackupKey(::grpc::ClientContext* context) { return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>>(RecoverBackupKeyRaw(context)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>> AsyncRecoverBackupKey(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>>(AsyncRecoverBackupKeyRaw(context, cq, tag)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>> PrepareAsyncRecoverBackupKey(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>>(PrepareAsyncRecoverBackupKeyRaw(context, cq)); } std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> PullBackup(::grpc::ClientContext* context) { return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(PullBackupRaw(context)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> AsyncPullBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(AsyncPullBackupRaw(context, cq, tag)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> PrepareAsyncPullBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(PrepareAsyncPullBackupRaw(context, cq)); } class async_interface { public: virtual ~async_interface() {} virtual void CreateNewBackup(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::CreateNewBackupRequest,::backup::CreateNewBackupResponse>* reactor) = 0; virtual void SendLog(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::ClientWriteReactor< ::backup::SendLogRequest>* reactor) = 0; virtual void RecoverBackupKey(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::RecoverBackupKeyRequest,::backup::RecoverBackupKeyResponse>* reactor) = 0; virtual void PullBackup(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::PullBackupRequest,::backup::PullBackupResponse>* reactor) = 0; }; typedef class async_interface experimental_async_interface; virtual class async_interface* async() { return nullptr; } class async_interface* experimental_async() { return async(); } private: virtual ::grpc::ClientReaderWriterInterface< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>* CreateNewBackupRaw(::grpc::ClientContext* context) = 0; virtual ::grpc::ClientAsyncReaderWriterInterface< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>* AsyncCreateNewBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; virtual ::grpc::ClientAsyncReaderWriterInterface< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>* PrepareAsyncCreateNewBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientWriterInterface< ::backup::SendLogRequest>* SendLogRaw(::grpc::ClientContext* context, ::google::protobuf::Empty* response) = 0; virtual ::grpc::ClientAsyncWriterInterface< ::backup::SendLogRequest>* AsyncSendLogRaw(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::CompletionQueue* cq, void* tag) = 0; virtual ::grpc::ClientAsyncWriterInterface< ::backup::SendLogRequest>* PrepareAsyncSendLogRaw(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* RecoverBackupKeyRaw(::grpc::ClientContext* context) = 0; virtual ::grpc::ClientAsyncReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* AsyncRecoverBackupKeyRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; virtual ::grpc::ClientAsyncReaderWriterInterface< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* PrepareAsyncRecoverBackupKeyRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* PullBackupRaw(::grpc::ClientContext* context) = 0; virtual ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* AsyncPullBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; virtual ::grpc::ClientAsyncReaderWriterInterface< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* PrepareAsyncPullBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0; }; class Stub final : public StubInterface { public: Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); std::unique_ptr< ::grpc::ClientReaderWriter< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>> CreateNewBackup(::grpc::ClientContext* context) { return std::unique_ptr< ::grpc::ClientReaderWriter< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>>(CreateNewBackupRaw(context)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>> AsyncCreateNewBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>>(AsyncCreateNewBackupRaw(context, cq, tag)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>> PrepareAsyncCreateNewBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>>(PrepareAsyncCreateNewBackupRaw(context, cq)); } std::unique_ptr< ::grpc::ClientWriter< ::backup::SendLogRequest>> SendLog(::grpc::ClientContext* context, ::google::protobuf::Empty* response) { return std::unique_ptr< ::grpc::ClientWriter< ::backup::SendLogRequest>>(SendLogRaw(context, response)); } std::unique_ptr< ::grpc::ClientAsyncWriter< ::backup::SendLogRequest>> AsyncSendLog(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::CompletionQueue* cq, void* tag) { return std::unique_ptr< ::grpc::ClientAsyncWriter< ::backup::SendLogRequest>>(AsyncSendLogRaw(context, response, cq, tag)); } std::unique_ptr< ::grpc::ClientAsyncWriter< ::backup::SendLogRequest>> PrepareAsyncSendLog(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncWriter< ::backup::SendLogRequest>>(PrepareAsyncSendLogRaw(context, response, cq)); } std::unique_ptr< ::grpc::ClientReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>> RecoverBackupKey(::grpc::ClientContext* context) { return std::unique_ptr< ::grpc::ClientReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>>(RecoverBackupKeyRaw(context)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>> AsyncRecoverBackupKey(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>>(AsyncRecoverBackupKeyRaw(context, cq, tag)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>> PrepareAsyncRecoverBackupKey(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>>(PrepareAsyncRecoverBackupKeyRaw(context, cq)); } std::unique_ptr< ::grpc::ClientReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> PullBackup(::grpc::ClientContext* context) { return std::unique_ptr< ::grpc::ClientReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(PullBackupRaw(context)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> AsyncPullBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(AsyncPullBackupRaw(context, cq, tag)); } std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>> PrepareAsyncPullBackup(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>>(PrepareAsyncPullBackupRaw(context, cq)); } class async final : public StubInterface::async_interface { public: void CreateNewBackup(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::CreateNewBackupRequest,::backup::CreateNewBackupResponse>* reactor) override; void SendLog(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::ClientWriteReactor< ::backup::SendLogRequest>* reactor) override; void RecoverBackupKey(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::RecoverBackupKeyRequest,::backup::RecoverBackupKeyResponse>* reactor) override; void PullBackup(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::backup::PullBackupRequest,::backup::PullBackupResponse>* reactor) override; private: friend class Stub; explicit async(Stub* stub): stub_(stub) { } Stub* stub() { return stub_; } Stub* stub_; }; class async* async() override { return &async_stub_; } private: std::shared_ptr< ::grpc::ChannelInterface> channel_; class async async_stub_{this}; ::grpc::ClientReaderWriter< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>* CreateNewBackupRaw(::grpc::ClientContext* context) override; ::grpc::ClientAsyncReaderWriter< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>* AsyncCreateNewBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReaderWriter< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>* PrepareAsyncCreateNewBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override; ::grpc::ClientWriter< ::backup::SendLogRequest>* SendLogRaw(::grpc::ClientContext* context, ::google::protobuf::Empty* response) override; ::grpc::ClientAsyncWriter< ::backup::SendLogRequest>* AsyncSendLogRaw(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncWriter< ::backup::SendLogRequest>* PrepareAsyncSendLogRaw(::grpc::ClientContext* context, ::google::protobuf::Empty* response, ::grpc::CompletionQueue* cq) override; ::grpc::ClientReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* RecoverBackupKeyRaw(::grpc::ClientContext* context) override; ::grpc::ClientAsyncReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* AsyncRecoverBackupKeyRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReaderWriter< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* PrepareAsyncRecoverBackupKeyRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override; ::grpc::ClientReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* PullBackupRaw(::grpc::ClientContext* context) override; ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* AsyncPullBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReaderWriter< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* PrepareAsyncPullBackupRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override; const ::grpc::internal::RpcMethod rpcmethod_CreateNewBackup_; const ::grpc::internal::RpcMethod rpcmethod_SendLog_; const ::grpc::internal::RpcMethod rpcmethod_RecoverBackupKey_; const ::grpc::internal::RpcMethod rpcmethod_PullBackup_; }; static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); class Service : public ::grpc::Service { public: Service(); virtual ~Service(); virtual ::grpc::Status CreateNewBackup(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::backup::CreateNewBackupResponse, ::backup::CreateNewBackupRequest>* stream); virtual ::grpc::Status SendLog(::grpc::ServerContext* context, ::grpc::ServerReader< ::backup::SendLogRequest>* reader, ::google::protobuf::Empty* response); virtual ::grpc::Status RecoverBackupKey(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::backup::RecoverBackupKeyResponse, ::backup::RecoverBackupKeyRequest>* stream); virtual ::grpc::Status PullBackup(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* stream); }; template class WithAsyncMethod_CreateNewBackup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_CreateNewBackup() { ::grpc::Service::MarkMethodAsync(0); } ~WithAsyncMethod_CreateNewBackup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status CreateNewBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::CreateNewBackupResponse, ::backup::CreateNewBackupRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestCreateNewBackup(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::backup::CreateNewBackupResponse, ::backup::CreateNewBackupRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag); } }; template class WithAsyncMethod_SendLog : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SendLog() { ::grpc::Service::MarkMethodAsync(1); } ~WithAsyncMethod_SendLog() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status SendLog(::grpc::ServerContext* /*context*/, ::grpc::ServerReader< ::backup::SendLogRequest>* /*reader*/, ::google::protobuf::Empty* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSendLog(::grpc::ServerContext* context, ::grpc::ServerAsyncReader< ::google::protobuf::Empty, ::backup::SendLogRequest>* reader, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncClientStreaming(1, context, reader, new_call_cq, notification_cq, tag); } }; template class WithAsyncMethod_RecoverBackupKey : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_RecoverBackupKey() { ::grpc::Service::MarkMethodAsync(2); } ~WithAsyncMethod_RecoverBackupKey() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status RecoverBackupKey(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::RecoverBackupKeyResponse, ::backup::RecoverBackupKeyRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestRecoverBackupKey(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::backup::RecoverBackupKeyResponse, ::backup::RecoverBackupKeyRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncBidiStreaming(2, context, stream, new_call_cq, notification_cq, tag); } }; template class WithAsyncMethod_PullBackup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_PullBackup() { ::grpc::Service::MarkMethodAsync(3); } ~WithAsyncMethod_PullBackup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestPullBackup(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncBidiStreaming(3, context, stream, new_call_cq, notification_cq, tag); } }; typedef WithAsyncMethod_CreateNewBackup > > > AsyncService; template class WithCallbackMethod_CreateNewBackup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_CreateNewBackup() { ::grpc::Service::MarkMethodCallback(0, new ::grpc::internal::CallbackBidiHandler< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>( [this]( ::grpc::CallbackServerContext* context) { return this->CreateNewBackup(context); })); } ~WithCallbackMethod_CreateNewBackup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status CreateNewBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::CreateNewBackupResponse, ::backup::CreateNewBackupRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } virtual ::grpc::ServerBidiReactor< ::backup::CreateNewBackupRequest, ::backup::CreateNewBackupResponse>* CreateNewBackup( ::grpc::CallbackServerContext* /*context*/) { return nullptr; } }; template class WithCallbackMethod_SendLog : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_SendLog() { ::grpc::Service::MarkMethodCallback(1, new ::grpc::internal::CallbackClientStreamingHandler< ::backup::SendLogRequest, ::google::protobuf::Empty>( [this]( ::grpc::CallbackServerContext* context, ::google::protobuf::Empty* response) { return this->SendLog(context, response); })); } ~WithCallbackMethod_SendLog() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status SendLog(::grpc::ServerContext* /*context*/, ::grpc::ServerReader< ::backup::SendLogRequest>* /*reader*/, ::google::protobuf::Empty* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } virtual ::grpc::ServerReadReactor< ::backup::SendLogRequest>* SendLog( ::grpc::CallbackServerContext* /*context*/, ::google::protobuf::Empty* /*response*/) { return nullptr; } }; template class WithCallbackMethod_RecoverBackupKey : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_RecoverBackupKey() { ::grpc::Service::MarkMethodCallback(2, new ::grpc::internal::CallbackBidiHandler< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>( [this]( ::grpc::CallbackServerContext* context) { return this->RecoverBackupKey(context); })); } ~WithCallbackMethod_RecoverBackupKey() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status RecoverBackupKey(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::RecoverBackupKeyResponse, ::backup::RecoverBackupKeyRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } virtual ::grpc::ServerBidiReactor< ::backup::RecoverBackupKeyRequest, ::backup::RecoverBackupKeyResponse>* RecoverBackupKey( ::grpc::CallbackServerContext* /*context*/) { return nullptr; } }; template class WithCallbackMethod_PullBackup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_PullBackup() { ::grpc::Service::MarkMethodCallback(3, new ::grpc::internal::CallbackBidiHandler< ::backup::PullBackupRequest, ::backup::PullBackupResponse>( [this]( ::grpc::CallbackServerContext* context) { return this->PullBackup(context); })); } ~WithCallbackMethod_PullBackup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } virtual ::grpc::ServerBidiReactor< ::backup::PullBackupRequest, ::backup::PullBackupResponse>* PullBackup( ::grpc::CallbackServerContext* /*context*/) { return nullptr; } }; typedef WithCallbackMethod_CreateNewBackup > > > CallbackService; typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_CreateNewBackup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_CreateNewBackup() { ::grpc::Service::MarkMethodGeneric(0); } ~WithGenericMethod_CreateNewBackup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status CreateNewBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::CreateNewBackupResponse, ::backup::CreateNewBackupRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } }; template class WithGenericMethod_SendLog : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SendLog() { ::grpc::Service::MarkMethodGeneric(1); } ~WithGenericMethod_SendLog() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status SendLog(::grpc::ServerContext* /*context*/, ::grpc::ServerReader< ::backup::SendLogRequest>* /*reader*/, ::google::protobuf::Empty* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } }; template class WithGenericMethod_RecoverBackupKey : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_RecoverBackupKey() { ::grpc::Service::MarkMethodGeneric(2); } ~WithGenericMethod_RecoverBackupKey() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status RecoverBackupKey(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::RecoverBackupKeyResponse, ::backup::RecoverBackupKeyRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } }; template class WithGenericMethod_PullBackup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_PullBackup() { ::grpc::Service::MarkMethodGeneric(3); } ~WithGenericMethod_PullBackup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } }; template class WithRawMethod_CreateNewBackup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_CreateNewBackup() { ::grpc::Service::MarkMethodRaw(0); } ~WithRawMethod_CreateNewBackup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status CreateNewBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::CreateNewBackupResponse, ::backup::CreateNewBackupRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestCreateNewBackup(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag); } }; template class WithRawMethod_SendLog : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SendLog() { ::grpc::Service::MarkMethodRaw(1); } ~WithRawMethod_SendLog() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status SendLog(::grpc::ServerContext* /*context*/, ::grpc::ServerReader< ::backup::SendLogRequest>* /*reader*/, ::google::protobuf::Empty* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSendLog(::grpc::ServerContext* context, ::grpc::ServerAsyncReader< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* reader, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncClientStreaming(1, context, reader, new_call_cq, notification_cq, tag); } }; template class WithRawMethod_RecoverBackupKey : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_RecoverBackupKey() { ::grpc::Service::MarkMethodRaw(2); } ~WithRawMethod_RecoverBackupKey() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status RecoverBackupKey(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::RecoverBackupKeyResponse, ::backup::RecoverBackupKeyRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestRecoverBackupKey(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncBidiStreaming(2, context, stream, new_call_cq, notification_cq, tag); } }; template class WithRawMethod_PullBackup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_PullBackup() { ::grpc::Service::MarkMethodRaw(3); } ~WithRawMethod_PullBackup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestPullBackup(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncBidiStreaming(3, context, stream, new_call_cq, notification_cq, tag); } }; template class WithRawCallbackMethod_CreateNewBackup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_CreateNewBackup() { ::grpc::Service::MarkMethodRawCallback(0, new ::grpc::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context) { return this->CreateNewBackup(context); })); } ~WithRawCallbackMethod_CreateNewBackup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status CreateNewBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::CreateNewBackupResponse, ::backup::CreateNewBackupRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } virtual ::grpc::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* CreateNewBackup( ::grpc::CallbackServerContext* /*context*/) { return nullptr; } }; template class WithRawCallbackMethod_SendLog : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_SendLog() { ::grpc::Service::MarkMethodRawCallback(1, new ::grpc::internal::CallbackClientStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, ::grpc::ByteBuffer* response) { return this->SendLog(context, response); })); } ~WithRawCallbackMethod_SendLog() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status SendLog(::grpc::ServerContext* /*context*/, ::grpc::ServerReader< ::backup::SendLogRequest>* /*reader*/, ::google::protobuf::Empty* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } virtual ::grpc::ServerReadReactor< ::grpc::ByteBuffer>* SendLog( ::grpc::CallbackServerContext* /*context*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template class WithRawCallbackMethod_RecoverBackupKey : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_RecoverBackupKey() { ::grpc::Service::MarkMethodRawCallback(2, new ::grpc::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context) { return this->RecoverBackupKey(context); })); } ~WithRawCallbackMethod_RecoverBackupKey() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status RecoverBackupKey(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::RecoverBackupKeyResponse, ::backup::RecoverBackupKeyRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } virtual ::grpc::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* RecoverBackupKey( ::grpc::CallbackServerContext* /*context*/) { return nullptr; } }; template class WithRawCallbackMethod_PullBackup : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_PullBackup() { ::grpc::Service::MarkMethodRawCallback(3, new ::grpc::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context) { return this->PullBackup(context); })); } ~WithRawCallbackMethod_PullBackup() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method ::grpc::Status PullBackup(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::backup::PullBackupResponse, ::backup::PullBackupRequest>* /*stream*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } virtual ::grpc::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* PullBackup( ::grpc::CallbackServerContext* /*context*/) { return nullptr; } }; typedef Service StreamedUnaryService; typedef Service SplitStreamedService; typedef Service StreamedService; }; } // namespace backup #endif // GRPC_backup_2eproto__INCLUDED diff --git a/native/cpp/CommonCpp/grpc/protos/backup.proto b/native/cpp/CommonCpp/grpc/protos/backup.proto index dc421aa58..ffde66b9e 100644 --- a/native/cpp/CommonCpp/grpc/protos/backup.proto +++ b/native/cpp/CommonCpp/grpc/protos/backup.proto @@ -1,126 +1,140 @@ syntax = "proto3"; package backup; import "google/protobuf/empty.proto"; +/** + * API - description + * CreateNewBackup - This method is called when we want to create a new backup. + * We send a new backup key encrypted with the user's password and also the + * new compaction. New logs that will be sent from now on will be assigned to + * this backup. + * SendLog - User sends a new log to the backup service. The log is being + * assigned to the latest(or desired) backup's compaction item. + * RecoverBackupKey - Pulls data necessary for regenerating the backup key + * on the client-side for the latest(or desired) backup + * PullBackup - Fetches compaction + all logs assigned to it for the + * specified backup(default is the last backup) + */ + service BackupService { rpc CreateNewBackup(stream CreateNewBackupRequest) returns (stream CreateNewBackupResponse) {} rpc SendLog(stream SendLogRequest) returns (google.protobuf.Empty) {} rpc RecoverBackupKey(stream RecoverBackupKeyRequest) returns (stream RecoverBackupKeyResponse) {} rpc PullBackup(stream PullBackupRequest) returns (stream PullBackupResponse) {} } // Helper types message PakeRegistrationRequestAndUserID { string userID = 1; bytes pakeRegistrationRequest = 2; } message PakeAuthenticationRequestData { oneof data { PakeRegistrationRequestAndUserID pakeRegistrationRequestAndUserID = 1; bytes pakeRegistrationUpload = 2; bytes pakeCredentialRequest = 3; bytes pakeCredentialFinalization = 4; bytes pakeClientMAC = 5; } } message WalletAuthenticationRequestData { string userID = 1; string walletAddress = 2; bytes signedMessage = 3; } message FullAuthenticationRequestData { oneof data { PakeAuthenticationRequestData pakeAuthenticationRequestData = 1; WalletAuthenticationRequestData walletAuthenticationRequestData = 2; } } message WalletAuthenticationResponseData { bool success = 1; } message PakeAuthenticationResponseData { oneof data { bytes pakeRegistrationResponse = 1; bool pakeRegistrationSuccess = 2; bytes pakeCredentialResponse = 3; bytes pakeServerMAC = 4; } } message FullAuthenticationResponseData { oneof data { PakeAuthenticationResponseData pakeAuthenticationResponseData = 1; WalletAuthenticationResponseData walletAuthenticationResponseData = 2; } } message SimpleAuthenticationRequestData { string backupID = 1; string userID = 2; } message BackupKeyEntropy { oneof data { bytes nonce = 1; bytes rawMessage = 2; } } // CreateNewBackup message CreateNewBackupRequest { oneof data { FullAuthenticationRequestData authenticationRequestData = 1; BackupKeyEntropy backupKeyEntropy = 2; bytes newCompactionChunk = 3; } } message CreateNewBackupResponse { oneof data { FullAuthenticationResponseData authenticationResponseData = 1; bool entropyValid = 2; string backupID = 3; } } // SendLog message SendLogRequest { SimpleAuthenticationRequestData authenticationData = 1; bytes logData = 2; } // RecoverBackupKey message RecoverBackupKeyRequest { FullAuthenticationRequestData authenticationData = 1; } message RecoverBackupKeyResponse { oneof data { FullAuthenticationResponseData authenticationResponseData = 1; BackupKeyEntropy backupKeyEntropy = 2; string backupID = 4; } } // PullBackup message PullBackupRequest { SimpleAuthenticationRequestData authenticationData = 1; } message PullBackupResponse { oneof data { bytes compactionChunk = 1; bytes logChunk = 2; } }