userver: samples/grpc_service/main.cpp
Loading...
Searching...
No Matches
samples/grpc_service/main.cpp
#include <call_greeter_client_test_handler.hpp>
#include <greeter_client.hpp>
#include <greeter_service.hpp>
int main(int argc, char* argv[]) {
const auto component_list = components::MinimalServerComponentList()
// Contains machinery common to all gRPC clients
.Append<ugrpc::client::CommonComponent>()
// Default client factory. You can create multiple instances of this
// component using `.Append<T>("name")` if different gRPC clients
// require different credentials or different grpc-core options.
// All gRPC services are registered in this component.
.Append<ugrpc::server::ServerComponent>()
// Custom components:
.Append<samples::GreeterClientComponent>()
.Append<samples::GreeterServiceComponent>()
.Append<samples::CallGreeterClientTestHandler>();
return utils::DaemonMain(argc, argv, component_list);
}