userver: userver/ugrpc/tests/standalone_client.hpp Source File
Loading...
Searching...
No Matches
standalone_client.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <string>
7#include <vector>
8
15
17#include <userver/ugrpc/client/impl/completion_queue_pool.hpp>
18#include <userver/ugrpc/impl/statistics_storage.hpp>
20
21USERVER_NAMESPACE_BEGIN
22
23namespace ugrpc::tests {
24
31public:
34 explicit StandaloneClientFactory(client::ClientFactorySettings&& client_factory_settings = {});
35
39 template <typename Client>
40 Client MakeClient(const std::string& endpoint) {
41 return client_factory_.MakeClient<Client>("test", endpoint);
42 }
43
45 client::ClientFactory& GetClientFactory() { return client_factory_; }
46
47private:
48 utils::statistics::Storage statistics_storage_;
49 utils::statistics::MetricsStoragePtr metrics_storage_;
51 client_statistics_storage_{std::in_place, statistics_storage_, ugrpc::impl::StatisticsDomain::kClient};
53 client::impl::CompletionQueuePool completion_queues_{1};
54 testsuite::GrpcControl testsuite_control_{{}, false};
55 SimpleClientMiddlewarePipeline simple_client_middleware_pipeline_;
56 client::ClientFactory client_factory_;
57};
58
60std::string MakeIpv6Endpoint(std::uint16_t port);
61
62} // namespace ugrpc::tests
63
64USERVER_NAMESPACE_END