3#include "data/Types.hpp"
4#include "util/Taggable.hpp"
5#include "util/log/Logger.hpp"
6#include "web/SubscriptionContextInterface.hpp"
8#include <boost/asio/spawn.hpp>
9#include <boost/json.hpp>
10#include <boost/json/object.hpp>
23 boost::asio::yield_context
yield;
46 boost::asio::yield_context
yield,
49 boost::json::object
params,
58 ,
method(std::move(command))
61 ,
session(std::move(subscriptionContext))
67 LOG(log.
debug()) <<
tag() <<
"new Context created";
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:110
Pump debug(std::source_location const &loc=std::source_location::current()) const
Interface for logging at Severity::DBG severity.
Definition Logger.cpp:494
A factory for TagDecorator instantiation.
Definition Taggable.hpp:165
A base class that allows attaching a tag decorator to a subclass.
Definition Taggable.hpp:236
BaseTagDecorator const & tag() const
Getter for tag decorator.
Definition Taggable.hpp:264
Taggable(util::TagDecoratorFactory const &tagFactory)
New Taggable from a specified factory.
Definition Taggable.hpp:246
This namespace implements the web server and related components.
Definition Types.hpp:23
std::shared_ptr< SubscriptionContextInterface > SubscriptionContextPtr
An alias for shared pointer to a SubscriptionContextInterface.
Definition SubscriptionContextInterface.hpp:64
Stores a range of sequences as a min and max pair.
Definition Types.hpp:246
Context that is used by the Webserver to pass around information about an incoming request.
Definition Context.hpp:22
SubscriptionContextPtr session
The subscription context of the connection.
Definition Context.hpp:27
std::string clientIp
IP of the peer.
Definition Context.hpp:29
Context(boost::asio::yield_context yield, std::string command, std::uint32_t apiVersion, boost::json::object params, SubscriptionContextPtr subscriptionContext, util::TagDecoratorFactory const &tagFactory, data::LedgerRange const &range, std::string clientIp, bool isAdmin)
Create a new Context instance.
Definition Context.hpp:45
data::LedgerRange range
The ledger range available at the time of the request.
Definition Context.hpp:28
std::uint32_t apiVersion
The api_version parsed from the request.
Definition Context.hpp:25
boost::asio::yield_context yield
The coroutine context the request is handled in.
Definition Context.hpp:23
boost::json::object params
Request's parameters/data as a JSON object.
Definition Context.hpp:26
std::string method
The method/command requested.
Definition Context.hpp:24
bool isAdmin
Whether the peer has admin privileges.
Definition Context.hpp:30