userver: ugrpc::server::ServerComponent Class Reference
Loading...
Searching...
No Matches
ugrpc::server::ServerComponent Class Referencefinal

Component that configures and manages the gRPC server. More...

#include <userver/ugrpc/server/server_component.hpp>

+ Inheritance diagram for ugrpc::server::ServerComponent:
+ Collaboration diagram for ugrpc::server::ServerComponent:

Public Member Functions

 ServerComponent (const components::ComponentConfig &config, const components::ComponentContext &context)
 
ServerGetServer () noexcept
 
- Public Member Functions inherited from components::LoggableComponentBase
 LoggableComponentBase (const ComponentConfig &, const ComponentContext &)
 
 LoggableComponentBase (LoggableComponentBase &&)=delete
 
 LoggableComponentBase (const LoggableComponentBase &)=delete
 
 ~LoggableComponentBase () override=default
 
ComponentHealth GetComponentHealth () const override
 
void OnLoadingCancelled () override
 
void OnAllComponentsLoaded () override
 
void OnAllComponentsAreStopping () override
 

Static Public Member Functions

static yaml_config::Schema GetStaticConfigSchema ()
 
- Static Public Member Functions inherited from components::LoggableComponentBase
static yaml_config::Schema GetStaticConfigSchema ()
 

Static Public Attributes

static constexpr std::string_view kName = "grpc-server"
 

Detailed Description

Component that configures and manages the gRPC server.

Static options:

The component name for static config is "grpc-server".

Name Description Default value
access-tskv-logger logger name for access-tskv.log -
port the port to use for all gRPC services, or 0 to pick any available -
channel-args a map of channel arguments, see gRPC Core docs {}
native-log-level min log level for the native gRPC library 'error'
enable-channelz initialize service with runtime info about gRPC connections false
service-defaults default config values for gRPC services, see config schema {}
See also
https://grpc.github.io/grpc/core/group__grpc__arg__keys.html
Examples
samples/grpc_service/grpc_service.cpp.

Definition at line 39 of file server_component.hpp.

Member Function Documentation

◆ GetServer()

Server & ugrpc::server::ServerComponent::GetServer ( )
noexcept
Returns
The contained Server instance
Note
All configuration must be performed at the components loading stage

Member Data Documentation

◆ kName

constexpr std::string_view ugrpc::server::ServerComponent::kName = "grpc-server"
staticconstexpr

Definition at line 41 of file server_component.hpp.


The documentation for this class was generated from the following file: