userver: userver/ugrpc/client/client_settings.hpp Source File
Loading...
Searching...
No Matches
client_settings.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/ugrpc/client/client_settings.hpp
4/// @brief @copybrief ugrpc::client::ClientSettings
5
6#include <cstddef>
7#include <string>
8#include <unordered_map>
9
10#include <userver/dynamic_config/snapshot.hpp>
11
12#include <userver/ugrpc/client/fwd.hpp>
13
14USERVER_NAMESPACE_BEGIN
15
16namespace ugrpc::client {
17
18// rpc method name -> count of channels
20
21/// Settings relating to creation of a code-generated client
22struct ClientSettings final {
23 /// **(Required)**
24 /// The name of the client, for diagnostics, credentials and middlewares.
25 std::string client_name;
26
27 /// **(Required)**
28 /// The URI to connect to, e.g. `http://my.domain.com:8080`.
29 /// Should not include any HTTP path, just schema, domain name and port. Unix
30 /// sockets are also supported. For details, see:
31 /// https://grpc.github.io/grpc/cpp/md_doc_naming.html
32 std::string endpoint;
33
34 /// **(Optional)**
35 /// The name of the QOS
36 /// @ref scripts/docs/en/userver/dynamic_config.md "dynamic config"
37 /// that will be applied automatically to every RPC.
38 ///
39 /// Timeout from QOS config is ignored if:
40 ///
41 /// * an explicit `qos` parameter is specified at RPC creation, or
42 /// * deadline is specified in the `client_context` passed at RPC creation.
43 ///
44 /// ## Client QOS config definition sample
45 ///
46 /// @snippet grpc/tests/tests/unit_test_client_qos.hpp qos config key
47 const dynamic_config::Key<ClientQos>* client_qos{nullptr};
48
49 /// **(Optional)**
50 /// Dedicated high-load methods that have separate channels
52};
53
54std::size_t GetMethodChannelCount(const DedicatedMethodsConfig& dedicated_methods_config, std::string_view method_name);
55
56} // namespace ugrpc::client
57
58USERVER_NAMESPACE_END