rippled
ripple
rpc
GRPCHandlers.h
1
//------------------------------------------------------------------------------
2
/*
3
This file is part of rippled: https://github.com/ripple/rippled
4
Copyright (c) 2020 Ripple Labs Inc.
5
6
Permission to use, copy, modify, and/or distribute this software for any
7
purpose with or without fee is hereby granted, provided that the above
8
copyright notice and this permission notice appear in all copies.
9
10
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
*/
18
//==============================================================================
19
20
#ifndef RIPPLE_RPC_GRPCHANDLER_H_INCLUDED
21
#define RIPPLE_RPC_GRPCHANDLER_H_INCLUDED
22
23
#include <ripple/rpc/Context.h>
24
#include <grpcpp/grpcpp.h>
25
#include <org/xrpl/rpc/v1/xrp_ledger.pb.h>
26
27
namespace
ripple
{
28
29
/*
30
* These handlers are for gRPC. They each take in a protobuf message that is
31
* nested inside RPC::GRPCContext<T>, where T is the request type
32
* The return value is the response type, as well as a status
33
* If the status is not Status::OK (meaning an error occurred), then only
34
* the status will be sent to the client, and the response will be ommitted
35
*/
36
37
std::pair<org::xrpl::rpc::v1::GetLedgerResponse, grpc::Status>
38
doLedgerGrpc
(RPC::GRPCContext<org::xrpl::rpc::v1::GetLedgerRequest>& context);
39
40
std::pair<org::xrpl::rpc::v1::GetLedgerEntryResponse, grpc::Status>
41
doLedgerEntryGrpc
(
42
RPC::GRPCContext<org::xrpl::rpc::v1::GetLedgerEntryRequest>& context);
43
44
std::pair<org::xrpl::rpc::v1::GetLedgerDataResponse, grpc::Status>
45
doLedgerDataGrpc
(
46
RPC::GRPCContext<org::xrpl::rpc::v1::GetLedgerDataRequest>& context);
47
48
std::pair<org::xrpl::rpc::v1::GetLedgerDiffResponse, grpc::Status>
49
doLedgerDiffGrpc
(
50
RPC::GRPCContext<org::xrpl::rpc::v1::GetLedgerDiffRequest>& context);
51
52
}
// namespace ripple
53
54
#endif
std::pair
ripple::doLedgerGrpc
std::pair< org::xrpl::rpc::v1::GetLedgerResponse, grpc::Status > doLedgerGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerRequest > &context)
Definition:
LedgerHandler.cpp:105
ripple::doLedgerDiffGrpc
std::pair< org::xrpl::rpc::v1::GetLedgerDiffResponse, grpc::Status > doLedgerDiffGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerDiffRequest > &context)
Definition:
LedgerDiff.cpp:6
ripple::doLedgerEntryGrpc
std::pair< org::xrpl::rpc::v1::GetLedgerEntryResponse, grpc::Status > doLedgerEntryGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerEntryRequest > &context)
Definition:
LedgerEntry.cpp:400
ripple::doLedgerDataGrpc
std::pair< org::xrpl::rpc::v1::GetLedgerDataResponse, grpc::Status > doLedgerDataGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerDataRequest > &context)
Definition:
LedgerData.cpp:135
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition:
RCLCensorshipDetector.h:29
Generated by
1.8.17