roar
|
Namespaces | |
namespace | Curl |
namespace | Detail |
namespace | Dns |
namespace | Literals |
namespace | MemoryLiterals |
namespace | Parser |
namespace | RegexLiterals |
Classes | |
class | Authorization |
struct | BasicAuth |
class | Client |
class | Cookie |
struct | CorsSettings |
Settings object to control CORS requests. More... | |
class | date |
struct | DigestAuth |
struct | Error |
Holds errors that are produced asynchronously anywhere. More... | |
struct | ErrorHandler |
class | Factory |
This factory creates sessions. More... | |
struct | FileAndStatus |
struct | FlexibleProviderUnwrapper |
struct | FlexibleProviderUnwrapper< HolderClassT, T, false > |
struct | Ipv4 |
struct | Ipv6 |
class | Jail |
struct | overloaded |
struct | ProtoRoute |
A proper Route is built up from this object. This object is usually created internally. More... | |
struct | PseudoRegex |
class | RangeFileBody |
This body is a file body, but with range request support. More... | |
struct | Ranges |
class | Request |
This class extends the boost::beast::http::request<BodyT> with additional convenience. More... | |
class | Response |
class | Route |
A route represents the mapping of a verb+path to a user provided function. More... | |
struct | RouteInfo |
This class is what is used in ROAR_GET, ROAR_PUT, ... requests All options you can set for routes behind these macros are part of this object. More... | |
struct | RouteOptions |
Options that modify the server behavior for a given route. More... | |
class | Router |
The route routes http requests to their respective handler functions. More... | |
class | ScopeExit |
struct | ServeInfo |
struct | ServeOptions |
class | Server |
class | Session |
class | ShutdownBarrier |
struct | SslServerContext |
class | StandardResponseProvider |
Implement your own StandardResponseProvider to make custom 404 pages etc. More... | |
class | StandardTextResponseProvider |
This standard response provider implementation produces very simple text responses. More... | |
struct | Url |
class | VoidBody |
This body is for reading into nothing. More... | |
class | WebsocketBase |
class | WebsocketClient |
struct | WebsocketReadResult |
class | WebsocketSession |
A WebsocketSession allows you to interact with a client via websocket protocol. More... | |
Typedefs | |
using | EmptyBodyRequest = Request< boost::beast::http::empty_body > |
template<typename HolderClassT , typename T , bool Optional = false> | |
using | FlexibleProvider = Detail::MakeVariantFromRetrievers_v< Optional, std::function< T(HolderClassT &)>, std::function< T const &(HolderClassT &)>, T const &(HolderClassT::*)(), T const &(HolderClassT::*)() const, T(HolderClassT::*)(), T(HolderClassT::*)() const, T HolderClassT::*, T > |
template<typename RequestListenerT > | |
using | HandlerType = void(RequestListenerT::*)(Session &, Request< boost::beast::http::empty_body > &&) |
template<typename RequestListenerT > | |
using | ServeHandlerType = ServeDecision(RequestListenerT::*)(Session &, Request< boost::beast::http::empty_body > const &, FileAndStatus const &, ServeOptions< RequestListenerT > &options) |
Enumerations | |
enum class | ServeDecision { Continue , Deny , Handled } |
enum class | RoutePathType { Unspecified , RegularString , Regex , ServedDirectory } |
Functions | |
BOOST_DEFINE_ENUM (AuthorizationScheme, Basic, Bearer, Digest, Hoba, Mutual, Ntlm, Vapid, Scram, Aws4_Hmac_Sha256, Other) | |
AuthorizationScheme | authorizationSchemeFromString (std::string_view) |
std::string | to_string (AuthorizationScheme scheme) |
CorsSettings | makePermissiveCorsSettings (std::string method) |
Reflects all requested headers and origin or sets the Kleene star. Is as permissive as possible. Least secure option. | |
CorsSettings | makePermissiveCorsSettings (boost::beast::http::verb method) |
Same as the makePermissiveCorsSettings(std::string method) overload. | |
template<typename StreamT > | |
StreamT & | operator<< (StreamT &stream, Error error) |
std::filesystem::path | resolvePath (std::filesystem::path const &path) |
Will replace prefixes like "~" and "%appdata%" with actual directories on linux and windows. | |
constexpr unsigned long long | operator""_Bytes (unsigned long long n) |
constexpr unsigned long long | operator""_KiB (unsigned long long n) |
constexpr unsigned long long | operator""_MiB (unsigned long long n) |
constexpr unsigned long long | operator""_GiB (unsigned long long n) |
constexpr unsigned long long | operator""_MemoryPage (unsigned long long n) |
PseudoRegex | operator""_rgx (char const *regexString, std::size_t length) |
std::optional< std::string > | extensionToMime (std::string const &extension) |
template<typename HolderClassT , typename T > | |
std::optional< T > | unwrapFlexibleProvider (HolderClassT &holder, FlexibleProvider< HolderClassT, T, true > const &flexibleProvider) |
template<typename HolderClassT , typename T > | |
T | unwrapFlexibleProvider (HolderClassT &holder, FlexibleProvider< HolderClassT, T, false > const &flexibleProvider) |
template<typename RequestListenerT > | |
auto | extendRouteInfo (RouteInfo< RequestListenerT > info, HandlerType< RequestListenerT > handler) |
template<typename RequestListenerT > | |
auto | extendRouteInfoForServe (ServeInfo< RequestListenerT > info, ServeHandlerType< RequestListenerT > handler) |
void | initializeServerSslContext (SslServerContext &ctx) |
A function to simplify the creation of ssl contexts. Make one on your own if you need more sophisticated settings. | |
boost::asio::ssl::context | makeSslContext (const std::string &certificate, const std::string &privateKey) |
std::string | urlEncode (const std::string &source) |
std::string | urlDecode (const std::string &source) |
std::string | base64Encode (std::vector< unsigned char > const &data) |
Encode vector in base64. | |
std::string | base64Encode (std::string const &str) |
Encode string in base64. | |
std::string | base64Decode (std::string const &base64String) |
Decode base64 to string. | |
std::string | base64Decode (std::string_view base64String) |
Decode base64 to string. | |
std::string | base64UrlEncode (std::vector< unsigned char > const &data, bool includePadding=false) |
encodes data using base64url algorithm, which is similar to base64, but uses - and _ instead of + and /. | |
std::vector< unsigned char > | base64UrlDecode (std::string_view const &base64String) |
Reverses the base64url encoding. | |
template<template< typename... > typename ContainerType, typename ElementType > | |
void | concatContainers (ContainerType< ElementType > &lhs, ContainerType< ElementType > const &rhs) |
template<template< typename... > typename ContainerType, typename ElementType > | |
void | concatContainers (ContainerType< ElementType > &lhs, ContainerType< ElementType > &&rhs) |
template<template< typename... > typename ContainerType, typename ElementType > | |
ContainerType< ElementType > | concatContainersCopy (ContainerType< ElementType > lhs, ContainerType< ElementType > const &rhs) |
template<template< typename... > typename ContainerType, typename ElementType > | |
ContainerType< ElementType > | concatContainersCopy (ContainerType< ElementType > lhs, ContainerType< ElementType > &&rhs) |
std::string | demangleCppSymbol (std::string const &name, std::vector< std::pair< std::string, std::string > > const &replacers={}, bool format=false) |
Demangles a C++ symbol. Useful for tests or debugging purposes. | |
template<typename... Ts> | |
overloaded (Ts...) -> overloaded< Ts... > | |
template<typename T > | |
ScopeExit (T) -> ScopeExit< T > | |
std::optional< std::string > | sha256 (std::string_view data) |
std::optional< std::string > | sha512 (std::string_view data) |
template<typename... VariantTypes, typename... VisitFunctionTypes> | |
auto | visitOverloaded (std::variant< VariantTypes... > const &variant, VisitFunctionTypes &&... visitFunctions) |
template<typename... VariantTypes, typename... VisitFunctionTypes> | |
auto | visitOverloaded (std::variant< VariantTypes... > &variant, VisitFunctionTypes &&... visitFunctions) |
template<typename... VariantTypes, typename... VisitFunctionTypes> | |
auto | visitOverloaded (std::variant< VariantTypes... > &&variant, VisitFunctionTypes &&... visitFunctions) |
std::unordered_map< std::string, std::string > const & | getMimeMapping () |
ROAR_PIMPL_SPECIAL_FUNCTIONS_IMPL (Route) | |
ROAR_PIMPL_SPECIAL_FUNCTIONS_IMPL (Router) | |
ROAR_PIMPL_SPECIAL_FUNCTIONS_IMPL (Factory) | |
ROAR_PIMPL_SPECIAL_FUNCTIONS_IMPL_NO_DTOR (Session) | |
std::string | tmFormatter (std::tm *tm, const char *suffix=nullptr) |
void | onSignal (int sig) |
Variables | |
ShutdownBarrier | shutdownBarrier |
using Roar::EmptyBodyRequest = typedef Request<boost::beast::http::empty_body> |
using Roar::FlexibleProvider = typedef Detail::MakeVariantFromRetrievers_v< Optional, std::function<T(HolderClassT&)>, std::function<T const&(HolderClassT&)>, T const& (HolderClassT::*)(), T const& (HolderClassT::*)() const, T (HolderClassT::*)(), T (HolderClassT::*)() const, T HolderClassT::*, T> |
using Roar::HandlerType = typedef void (RequestListenerT::*)(Session&, Request<boost::beast::http::empty_body>&&) |
using Roar::ServeHandlerType = typedef ServeDecision (RequestListenerT::*)( Session&, Request<boost::beast::http::empty_body> const&, FileAndStatus const&, ServeOptions<RequestListenerT>& options) |
|
strong |
|
strong |
AuthorizationScheme Roar::authorizationSchemeFromString | ( | std::string_view | view | ) |
std::string Roar::base64Decode | ( | std::string const & | base64String | ) |
Decode base64 to string.
base64String |
std::string Roar::base64Decode | ( | std::string_view | base64String | ) |
Decode base64 to string.
base64String |
std::string Roar::base64Encode | ( | std::string const & | str | ) |
Encode string in base64.
str |
std::string Roar::base64Encode | ( | std::vector< unsigned char > const & | data | ) |
Encode vector in base64.
str |
std::vector< unsigned char > Roar::base64UrlDecode | ( | std::string_view const & | base64String | ) |
Reverses the base64url encoding.
base64String | An encoded string. |
std::string Roar::base64UrlEncode | ( | std::vector< unsigned char > const & | data, |
bool | includePadding = false |
||
) |
encodes data using base64url algorithm, which is similar to base64, but uses - and _ instead of + and /.
data | The binary data to encode |
includePadding | determines whether to include url encoded equal signs at the end so that they exist as %3D |
Roar::BOOST_DEFINE_ENUM | ( | AuthorizationScheme | , |
Basic | , | ||
Bearer | , | ||
Digest | , | ||
Hoba | , | ||
Mutual | , | ||
Ntlm | , | ||
Vapid | , | ||
Scram | , | ||
Aws4_Hmac_Sha256 | , | ||
Other | |||
) |
void Roar::concatContainers | ( | ContainerType< ElementType > & | lhs, |
ContainerType< ElementType > && | rhs | ||
) |
void Roar::concatContainers | ( | ContainerType< ElementType > & | lhs, |
ContainerType< ElementType > const & | rhs | ||
) |
ContainerType< ElementType > Roar::concatContainersCopy | ( | ContainerType< ElementType > | lhs, |
ContainerType< ElementType > && | rhs | ||
) |
ContainerType< ElementType > Roar::concatContainersCopy | ( | ContainerType< ElementType > | lhs, |
ContainerType< ElementType > const & | rhs | ||
) |
|
inline |
Demangles a C++ symbol. Useful for tests or debugging purposes.
name | The mangled name |
auto Roar::extendRouteInfo | ( | RouteInfo< RequestListenerT > | info, |
HandlerType< RequestListenerT > | handler | ||
) |
auto Roar::extendRouteInfoForServe | ( | ServeInfo< RequestListenerT > | info, |
ServeHandlerType< RequestListenerT > | handler | ||
) |
std::optional< std::string > Roar::extensionToMime | ( | std::string const & | extension | ) |
std::unordered_map< std::string, std::string > const & Roar::getMimeMapping | ( | ) |
void Roar::initializeServerSslContext | ( | SslServerContext & | ctx | ) |
A function to simplify the creation of ssl contexts. Make one on your own if you need more sophisticated settings.
settings |
|
inline |
Same as the makePermissiveCorsSettings(std::string method) overload.
method | The method to allow. |
|
inline |
Reflects all requested headers and origin or sets the Kleene star. Is as permissive as possible. Least secure option.
method | The method to allow. |
boost::asio::ssl::context Roar::makeSslContext | ( | const std::string & | certificate, |
const std::string & | privateKey | ||
) |
void Roar::onSignal | ( | int | sig | ) |
StreamT & Roar::operator<< | ( | StreamT & | stream, |
Error | error | ||
) |
Roar::overloaded | ( | Ts... | ) | -> overloaded< Ts... > |
std::filesystem::path Roar::resolvePath | ( | std::filesystem::path const & | path | ) |
Will replace prefixes like "~" and "%appdata%" with actual directories on linux and windows.
The percent values are case insensitive. ~ Linux: home. Windows: home userprofile% Linux: home. Windows: home appdata% Linux: home. Windows: CSIDL_APPDATA localappdata% Linux: home. Windows: CSIDL_APPDATA_LOCAL temp% Linux: /tmp. Windows: ${USER}\AppData\Local\Temp
path |
Roar::ROAR_PIMPL_SPECIAL_FUNCTIONS_IMPL | ( | Factory | ) |
Roar::ROAR_PIMPL_SPECIAL_FUNCTIONS_IMPL | ( | Route | ) |
Roar::ROAR_PIMPL_SPECIAL_FUNCTIONS_IMPL | ( | Router | ) |
Roar::ROAR_PIMPL_SPECIAL_FUNCTIONS_IMPL_NO_DTOR | ( | Session | ) |
Roar::ScopeExit | ( | T | ) | -> ScopeExit< T > |
std::optional< std::string > Roar::sha256 | ( | std::string_view | data | ) |
std::optional< std::string > Roar::sha512 | ( | std::string_view | data | ) |
std::string Roar::tmFormatter | ( | std::tm * | tm, |
const char * | suffix = nullptr |
||
) |
std::string Roar::to_string | ( | AuthorizationScheme | scheme | ) |
T Roar::unwrapFlexibleProvider | ( | HolderClassT & | holder, |
FlexibleProvider< HolderClassT, T, false > const & | flexibleProvider | ||
) |
std::optional< T > Roar::unwrapFlexibleProvider | ( | HolderClassT & | holder, |
FlexibleProvider< HolderClassT, T, true > const & | flexibleProvider | ||
) |
std::string Roar::urlDecode | ( | const std::string & | source | ) |
std::string Roar::urlEncode | ( | const std::string & | source | ) |
auto Roar::visitOverloaded | ( | std::variant< VariantTypes... > && | variant, |
VisitFunctionTypes &&... | visitFunctions | ||
) |
auto Roar::visitOverloaded | ( | std::variant< VariantTypes... > & | variant, |
VisitFunctionTypes &&... | visitFunctions | ||
) |
auto Roar::visitOverloaded | ( | std::variant< VariantTypes... > const & | variant, |
VisitFunctionTypes &&... | visitFunctions | ||
) |
ShutdownBarrier Roar::shutdownBarrier |