rippled
Loading...
Searching...
No Matches
xrpld
rpc
Context.h
1
//------------------------------------------------------------------------------
2
/*
3
This file is part of rippled: https://github.com/ripple/rippled
4
Copyright (c) 2012, 2013 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_CONTEXT_H_INCLUDED
21
#define RIPPLE_RPC_CONTEXT_H_INCLUDED
22
23
#include <xrpld/core/JobQueue.h>
24
#include <xrpld/rpc/InfoSub.h>
25
#include <xrpld/rpc/Role.h>
26
27
#include <xrpl/beast/utility/Journal.h>
28
29
namespace
ripple
{
30
31
class
Application;
32
class
NetworkOPs;
33
class
LedgerMaster;
34
35
namespace
RPC {
36
38
struct
Context
39
{
40
beast::Journal
const
j
;
41
Application
&
app
;
42
Resource::Charge
&
loadType
;
43
NetworkOPs
&
netOps
;
44
LedgerMaster
&
ledgerMaster
;
45
Resource::Consumer
&
consumer
;
46
Role
role
;
47
std::shared_ptr<JobQueue::Coro>
coro
{};
48
InfoSub::pointer
infoSub
{};
49
unsigned
int
apiVersion
;
50
};
51
52
struct
JsonContext
:
public
Context
53
{
57
struct
Headers
58
{
59
std::string_view
user
;
60
std::string_view
forwardedFor
;
61
};
62
63
Json::Value
params
;
64
65
Headers
headers
{};
66
};
67
68
template
<
class
RequestType>
69
struct
GRPCContext
:
public
Context
70
{
71
RequestType
params
;
72
};
73
74
}
// namespace RPC
75
}
// namespace ripple
76
77
#endif
std::string_view
Json::Value
Represents a JSON value.
Definition
json_value.h:149
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:60
ripple::Application
Definition
Application.h:114
ripple::LedgerMaster
Definition
LedgerMaster.h:52
ripple::NetworkOPs
Provides server functionality for clients.
Definition
NetworkOPs.h:89
ripple::Resource::Charge
A consumption charge.
Definition
Charge.h:30
ripple::Resource::Consumer
An endpoint that consumes resources.
Definition
Consumer.h:36
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:25
ripple::Role
Role
Indicates the level of administrative permission to grant.
Definition
Role.h:44
std::shared_ptr
ripple::RPC::Context
The context of information needed to call an RPC.
Definition
Context.h:39
ripple::RPC::Context::apiVersion
unsigned int apiVersion
Definition
Context.h:49
ripple::RPC::Context::role
Role role
Definition
Context.h:46
ripple::RPC::Context::coro
std::shared_ptr< JobQueue::Coro > coro
Definition
Context.h:47
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition
Context.h:42
ripple::RPC::Context::app
Application & app
Definition
Context.h:41
ripple::RPC::Context::infoSub
InfoSub::pointer infoSub
Definition
Context.h:48
ripple::RPC::Context::j
beast::Journal const j
Definition
Context.h:40
ripple::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition
Context.h:44
ripple::RPC::Context::netOps
NetworkOPs & netOps
Definition
Context.h:43
ripple::RPC::Context::consumer
Resource::Consumer & consumer
Definition
Context.h:45
ripple::RPC::GRPCContext
Definition
Context.h:70
ripple::RPC::GRPCContext::params
RequestType params
Definition
Context.h:71
ripple::RPC::JsonContext::Headers
Data passed in from HTTP headers.
Definition
Context.h:58
ripple::RPC::JsonContext::Headers::forwardedFor
std::string_view forwardedFor
Definition
Context.h:60
ripple::RPC::JsonContext::Headers::user
std::string_view user
Definition
Context.h:59
ripple::RPC::JsonContext
Definition
Context.h:53
ripple::RPC::JsonContext::params
Json::Value params
Definition
Context.h:63
ripple::RPC::JsonContext::headers
Headers headers
Definition
Context.h:65
Generated by
1.9.8