userver: userver/ugrpc/client/client_factory_settings.hpp Source File
Loading...
Searching...
No Matches
client_factory_settings.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/ugrpc/client/client_factory_settings.hpp
4/// @brief @copybrief ugrpc::client::ClientFactorySettings
5
6#include <memory>
7#include <string>
8#include <unordered_map>
9
10#include <grpcpp/security/credentials.h>
11#include <grpcpp/support/channel_arguments.h>
12
13#include <userver/logging/level.hpp>
14
15USERVER_NAMESPACE_BEGIN
16
17namespace ugrpc::client {
18
19// full rpc name -> count of channels
21
22/// Settings relating to the ClientFactory
23struct ClientFactorySettings final {
24 /// gRPC channel credentials, none by default
25 std::shared_ptr<grpc::ChannelCredentials> credentials{grpc::InsecureChannelCredentials()};
26
27 /// gRPC channel credentials by client_name. If not set, default `credentials`
28 /// is used instead.
30
31 /// Optional grpc-core channel args
32 /// @see https://grpc.github.io/grpc/core/group__grpc__arg__keys.html
33 grpc::ChannelArguments channel_args{};
34
35 /// The logging level override for the internal grpcpp library. Must be either
36 /// `kDebug`, `kInfo` or `kError`.
38
39 /// Number of underlying channels that will be created for every client
40 /// in this factory.
41 std::size_t channel_count{1};
42};
43
44} // namespace ugrpc::client
45
46USERVER_NAMESPACE_END