mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
add flag call_nearby_identity_api and make api::SharingRpcClient base class of NearbyIdentityGrpcClient.
PiperOrigin-RevId: 698945381
This commit is contained in:
committed by
Copybara-Service
parent
f5e526317b
commit
266a773cf8
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "absl/functional/any_invocable.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "proto/identity/v1/rpcs.pb.h"
|
||||
#include "sharing/internal/api/sharing_rpc_notifier.h"
|
||||
#include "sharing/proto/certificate_rpc.pb.h"
|
||||
#include "sharing/proto/contact_rpc.pb.h"
|
||||
@@ -26,6 +27,29 @@
|
||||
|
||||
namespace nearby::sharing::api {
|
||||
|
||||
// IdentityRpcClient is used to access Nearby Identity backend APIs.
|
||||
class IdentityRpcClient {
|
||||
public:
|
||||
IdentityRpcClient() = default;
|
||||
virtual ~IdentityRpcClient() = default;
|
||||
|
||||
virtual void QuerySharedCredentials(
|
||||
const google::nearby::identity::v1::QuerySharedCredentialsRequest&
|
||||
request,
|
||||
absl::AnyInvocable<
|
||||
void(const absl::StatusOr<
|
||||
google::nearby::identity::v1::QuerySharedCredentialsResponse>&
|
||||
response) &&>
|
||||
callback) = 0;
|
||||
|
||||
virtual void PublishDevice(
|
||||
const google::nearby::identity::v1::PublishDeviceRequest& request,
|
||||
absl::AnyInvocable<
|
||||
void(const absl::StatusOr<google::nearby::identity::v1::
|
||||
PublishDeviceResponse>& response) &&>
|
||||
callback) = 0;
|
||||
};
|
||||
|
||||
// SharingRpcClient is used to access Nearby Share backend APIs.
|
||||
class SharingRpcClient {
|
||||
public:
|
||||
@@ -64,6 +88,7 @@ class SharingRpcClientFactory {
|
||||
virtual ~SharingRpcClientFactory() = default;
|
||||
|
||||
virtual std::unique_ptr<SharingRpcClient> CreateInstance() = 0;
|
||||
virtual std::unique_ptr<IdentityRpcClient> CreateIdentityInstance() = 0;
|
||||
virtual api::SharingRpcNotifier* GetRpcNotifier() const = 0;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user