userver: userver/ugrpc/client/client_qos.hpp Source File
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
client_qos.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/ugrpc/client/client_qos.hpp
4/// @brief @copybrief ugrpc::client::ClientQos
5
6#include <userver/dynamic_config/snapshot.hpp>
7#include <userver/utils/default_dict.hpp>
8
9#include <userver/ugrpc/client/qos.hpp>
10
11USERVER_NAMESPACE_BEGIN
12
13namespace ugrpc::client {
14
15struct GlobalQos final {};
16
17bool operator==(const GlobalQos& lhs, const GlobalQos& rhs) noexcept;
18
19GlobalQos Parse(const formats::json::Value& value, formats::parse::To<GlobalQos>);
20
21formats::json::Value Serialize(const GlobalQos&, formats::serialize::To<formats::json::Value>);
22
23struct ClientQos {
24 /// @brief Maps full RPC names (`full.service.Name/MethodName`) to their QOS
25 /// configs. It is also possible to set `__default__` QOS that will be used
26 /// in place of missing entries.
27 utils::DefaultDict<Qos> methods;
28
29 /// @brief Properties that could not be specified per-method.
30 std::optional<GlobalQos> global;
31};
32
33bool operator==(const ClientQos& lhs, const ClientQos& rhs) noexcept;
34
35ClientQos Parse(const formats::json::Value& value, formats::parse::To<ClientQos>);
36
37formats::json::Value Serialize(const ClientQos& client_qos, formats::serialize::To<formats::json::Value>);
38
39namespace impl {
40extern const dynamic_config::Key<ClientQos> kNoClientQos;
41} // namespace impl
42
43} // namespace ugrpc::client
44
45USERVER_NAMESPACE_END