userver: samples/grpc_service/src/greeter_service.hpp
Loading...
Searching...
No Matches
samples/grpc_service/src/greeter_service.hpp
#pragma once
#include <string_view>
#include <samples/greeter_service.usrv.pb.hpp>
namespace samples {
class GreeterService final : public api::GreeterServiceBase {
public:
explicit GreeterService(std::string prefix);
void SayHello(SayHelloCall& call, api::GreetingRequest&& request) override;
void SayHelloResponseStream(SayHelloResponseStreamCall& call,
api::GreetingRequest&& request) override;
void SayHelloRequestStream(SayHelloRequestStreamCall& call) override;
void SayHelloStreams(SayHelloStreamsCall& call) override;
private:
const std::string prefix_;
};
class GreeterServiceComponent final
public:
static constexpr std::string_view kName = "greeter-service";
GreeterServiceComponent(const components::ComponentConfig& config,
static yaml_config::Schema GetStaticConfigSchema();
private:
GreeterService service_;
};
} // namespace samples