fix: generate cpp grpc services (#64)
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: greptime/v1/prom.proto
|
||||
|
||||
#include "greptime/v1/prom.pb.h"
|
||||
#include "greptime/v1/prom.grpc.pb.h"
|
||||
|
||||
#include <functional>
|
||||
#include <grpcpp/support/async_stream.h>
|
||||
#include <grpcpp/support/async_unary_call.h>
|
||||
#include <grpcpp/impl/channel_interface.h>
|
||||
#include <grpcpp/impl/client_unary_call.h>
|
||||
#include <grpcpp/support/client_callback.h>
|
||||
#include <grpcpp/support/message_allocator.h>
|
||||
#include <grpcpp/support/method_handler.h>
|
||||
#include <grpcpp/impl/rpc_service_method.h>
|
||||
#include <grpcpp/support/server_callback.h>
|
||||
#include <grpcpp/impl/codegen/server_callback_handlers.h>
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
namespace greptime {
|
||||
namespace v1 {
|
||||
|
||||
static const char* PrometheusGateway_method_names[] = {
|
||||
"/greptime.v1.PrometheusGateway/Handle",
|
||||
};
|
||||
|
||||
std::unique_ptr< PrometheusGateway::Stub> PrometheusGateway::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
|
||||
(void)options;
|
||||
std::unique_ptr< PrometheusGateway::Stub> stub(new PrometheusGateway::Stub(channel, options));
|
||||
return stub;
|
||||
}
|
||||
|
||||
PrometheusGateway::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options)
|
||||
: channel_(channel), rpcmethod_Handle_(PrometheusGateway_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
{}
|
||||
|
||||
::grpc::Status PrometheusGateway::Stub::Handle(::grpc::ClientContext* context, const ::greptime::v1::PromqlRequest& request, ::greptime::v1::PromqlResponse* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall< ::greptime::v1::PromqlRequest, ::greptime::v1::PromqlResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Handle_, context, request, response);
|
||||
}
|
||||
|
||||
void PrometheusGateway::Stub::async::Handle(::grpc::ClientContext* context, const ::greptime::v1::PromqlRequest* request, ::greptime::v1::PromqlResponse* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc::internal::CallbackUnaryCall< ::greptime::v1::PromqlRequest, ::greptime::v1::PromqlResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Handle_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void PrometheusGateway::Stub::async::Handle(::grpc::ClientContext* context, const ::greptime::v1::PromqlRequest* request, ::greptime::v1::PromqlResponse* response, ::grpc::ClientUnaryReactor* reactor) {
|
||||
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Handle_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::greptime::v1::PromqlResponse>* PrometheusGateway::Stub::PrepareAsyncHandleRaw(::grpc::ClientContext* context, const ::greptime::v1::PromqlRequest& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::greptime::v1::PromqlResponse, ::greptime::v1::PromqlRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Handle_, context, request);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::greptime::v1::PromqlResponse>* PrometheusGateway::Stub::AsyncHandleRaw(::grpc::ClientContext* context, const ::greptime::v1::PromqlRequest& request, ::grpc::CompletionQueue* cq) {
|
||||
auto* result =
|
||||
this->PrepareAsyncHandleRaw(context, request, cq);
|
||||
result->StartCall();
|
||||
return result;
|
||||
}
|
||||
|
||||
PrometheusGateway::Service::Service() {
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
PrometheusGateway_method_names[0],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< PrometheusGateway::Service, ::greptime::v1::PromqlRequest, ::greptime::v1::PromqlResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
|
||||
[](PrometheusGateway::Service* service,
|
||||
::grpc::ServerContext* ctx,
|
||||
const ::greptime::v1::PromqlRequest* req,
|
||||
::greptime::v1::PromqlResponse* resp) {
|
||||
return service->Handle(ctx, req, resp);
|
||||
}, this)));
|
||||
}
|
||||
|
||||
PrometheusGateway::Service::~Service() {
|
||||
}
|
||||
|
||||
::grpc::Status PrometheusGateway::Service::Handle(::grpc::ServerContext* context, const ::greptime::v1::PromqlRequest* request, ::greptime::v1::PromqlResponse* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
|
||||
} // namespace greptime
|
||||
} // namespace v1
|
||||
|
||||
Reference in New Issue
Block a user