|
drogon
C++14/17-based HTTP application framework
|
Drogon Test is a minimal effort test framework developed because the major C++ test frameworks doesn't handle async programs well. Drogon Test's syntax is inspired by both Google Test and Catch2. More...
Classes | |
| struct | AsyncTask |
| class | Attributes |
| This class represents the attributes stored in the HTTP request. One can add/get any type of data to/from an Attributes object. More... | |
| struct | await_result |
| class | CacheMap |
| Cache Map. More... | |
| struct | CallbackAwaiter |
| struct | CallbackAwaiter< void > |
| class | CallbackEntry |
| A utility class for CacheMap. More... | |
| class | Cookie |
| this class represents a cookie entity. More... | |
| class | DrClassMap |
| A map class which can create DrObjects from names. More... | |
| class | DrObject |
| class | DrObjectBase |
| The base class for all drogon reflection classes. More... | |
| class | DrTemplate |
| class | DrTemplateBase |
| The templating engine class. More... | |
| struct | final_awaiter |
| An awaiter for Task::promise_type::final_suspend(). Transfer execution back to the coroutine who is co_awaiting this Task. More... | |
| class | HttpAppFramework |
| class | HttpClient |
| Asynchronous http client. More... | |
| class | HttpController |
| The reflection base class template for HTTP controllers. More... | |
| class | HttpControllerBase |
| The base class for HTTP controllers. More... | |
| class | HttpFile |
| This class represents a uploaded file by a HTTP request. More... | |
| class | HttpFilter |
| The reflection base class template for filters. More... | |
| class | HttpFilterBase |
| The abstract base class for filters For more details on the class, see the wiki site (the 'Filter' section). More... | |
| class | HttpMiddleware |
| The reflection base class template for middlewares. More... | |
| class | HttpMiddlewareBase |
| The abstract base class for middleware. More... | |
| class | HttpOptionsMiddleware |
| class | HttpOptionsMiddlewareAuto |
| class | HttpOptionsMiddlewareImpl |
| Simple middleware that tags OPTIONS requests. More... | |
| class | HttpRequest |
| Abstract class for webapp developer to get or set the Http request;. More... | |
| class | HttpResponse |
| class | HttpSimpleController |
| The reflection base class template for HTTP simple controllers. More... | |
| class | HttpSimpleControllerBase |
| The abstract base class for HTTP simple controllers. More... | |
| class | HttpViewData |
| This class represents the data set displayed in views. More... | |
| class | IntranetIpFilter |
| A filter that prohibit access from external networks. More... | |
| class | IOThreadStorage |
| Utility class for thread storage handling. More... | |
| struct | is_awaitable |
| struct | is_awaitable< T, std::void_t< decltype(internal::getAwaiter(std::declval< T >()))> > |
| struct | is_resumable |
| struct | is_resumable< AsyncTask, std::void_t< AsyncTask > > |
| struct | is_resumable< T, std::void_t< decltype(internal::getAwaiter(std::declval< T >()))> > |
| struct | isAutoCreationClass |
| struct | IsPlugin |
| class | LocalHostFilter |
| A filter that prohibit access from other hosts. More... | |
| struct | MultipartHeader |
| class | MultiPartParser |
| class | Mutex |
| class | NotFound |
| This class is used by the drogon to generate the 404 page. Users don't use this class directly. More... | |
| class | OStringStream |
| class | Plugin |
| The reflection base class for plugins. More... | |
| class | PluginBase |
| The abstract base class for plugins. More... | |
| class | PubSubService |
| This class template implements a publish-subscribe pattern with multiple named topics. More... | |
| class | RateLimiter |
| This class is used to limit the number of requests per second. More... | |
| class | RequestStream |
| class | RequestStreamReader |
| class | ResponseStream |
| class | RestfulController |
| this class is a helper class for the implementation of restful api controllers generated by the drogon_ctl command. More... | |
| class | SafeRateLimiter |
| class | Session |
| This class represents a session stored in the framework. One can get or set any type of data to a session object. More... | |
| class | StreamError |
| struct | Task |
| struct | Task< void > |
| struct | task_awaiter |
| Convert Task to an awaiter when it is co_awaited. Following things will happen: More... | |
| class | Topic |
| This class template presents an unnamed topic. More... | |
| class | UploadFile |
| class | WebSocketClient |
| WebSocket client abstract class. More... | |
| class | WebSocketConnection |
| The WebSocket connection abstract class. More... | |
| class | WebSocketController |
| The reflection base class template for WebSocket controllers. More... | |
| class | WebSocketControllerBase |
| The abstract base class for WebSocket controllers. More... | |
Typedefs | |
| using | AttributesPtr = std::shared_ptr<Attributes> |
| using | CallbackEntryPtr = std::shared_ptr<CallbackEntry> |
| using | WeakCallbackEntryPtr = std::weak_ptr<CallbackEntry> |
| using | CallbackBucket = std::unordered_set<CallbackEntryPtr> |
| using | CallbackBucketQueue = std::deque<CallbackBucket> |
| using | DrAllocFunc = std::function<DrObjectBase *()> |
| using | DrSharedAllocFunc = std::function<std::shared_ptr<DrObjectBase>()> |
| using | DrTemplateData = HttpViewData |
| using | ExceptionHandler |
| using | DefaultHandler |
| using | HttpHandlerInfo = std::tuple<std::string, HttpMethod, std::string> |
| using | HttpClientPtr = std::shared_ptr<HttpClient> |
| using | HttpRequestPtr = std::shared_ptr<HttpRequest> |
| using | RequestStreamReaderPtr = std::shared_ptr<RequestStreamReader> |
| using | RequestStreamPtr = std::shared_ptr<RequestStream> |
| using | HttpResponsePtr = std::shared_ptr<HttpResponse> |
| using | ResponseStreamPtr = std::unique_ptr<ResponseStream> |
| using | FileUpload = MultiPartParser |
| In order to be compatible with old interfaces. | |
| using | SessionPtr = std::shared_ptr<Session> |
| using | WebSocketClientPtr = std::shared_ptr<WebSocketClient> |
| using | WebSocketRequestCallback |
| using | WebSocketConnectionPtr = std::shared_ptr<WebSocketConnection> |
| using | WebSocketControllerBasePtr = std::shared_ptr<WebSocketControllerBase> |
| using | AdviceCallback = std::function<void(const HttpResponsePtr &)> |
| using | AdviceChainCallback = std::function<void()> |
| using | AdviceStartSessionCallback = std::function<void(const std::string &)> |
| using | AdviceDestroySessionCallback = std::function<void(const std::string &)> |
| using | FilterCallback = std::function<void(const HttpResponsePtr &)> |
| using | FilterChainCallback = std::function<void()> |
| using | HttpReqCallback = std::function<void(ReqResult, const HttpResponsePtr &)> |
| using | MiddlewareCallback = std::function<void(const HttpResponsePtr &)> |
| using | MiddlewareNextCallback |
| using | SubscriberID = uint64_t |
| using | RateLimiterPtr = std::shared_ptr<RateLimiter> |
| template<typename T> | |
| using | await_result_t = typename await_result<T>::type |
| template<typename T> | |
| using | SafeStringMap |
Functions | |
| DROGON_EXPORT std::string | getVersion () |
| DROGON_EXPORT std::string | getGitCommit () |
| HttpAppFramework & | app () |
| A wrapper of the instance() method. | |
| template<typename T> | |
| T | fromRequest (const HttpRequest &) |
| This template is used to convert a request object to a custom type object. Users must specialize the template for a particular type. | |
| template<typename T> | |
| HttpRequestPtr | toRequest (T &&) |
| This template is used to create a request object from a custom type object by calling the newCustomHttpRequest(). Users must specialize the template for a particular type. | |
| template<> | |
| HttpRequestPtr | toRequest< const Json::Value & > (const Json::Value &pJson) |
| template<> | |
| HttpRequestPtr | toRequest (Json::Value &&pJson) |
| template<> | |
| HttpRequestPtr | toRequest< Json::Value & > (Json::Value &pJson) |
| template<> | |
| std::shared_ptr< Json::Value > | fromRequest (const HttpRequest &req) |
| template<> | |
| HttpRequestPtr | toRequest< const Json::Value & > (const Json::Value &pJson) |
| template<> | |
| HttpRequestPtr | toRequest (Json::Value &&pJson) |
| template<> | |
| std::shared_ptr< Json::Value > | fromRequest (const HttpRequest &req) |
| template<typename T> | |
| T | fromResponse (const HttpResponse &) |
| This template is used to convert a response object to a custom type object. Users must specialize the template for a particular type. | |
| template<typename T> | |
| HttpResponsePtr | toResponse (T &&) |
| This template is used to create a response object from a custom type object by calling the newCustomHttpResponse(). Users must specialize the template for a particular type. | |
| template<> | |
| HttpResponsePtr | toResponse< const Json::Value & > (const Json::Value &pJson) |
| template<> | |
| HttpResponsePtr | toResponse (Json::Value &&pJson) |
| template<> | |
| HttpResponsePtr | toResponse< Json::Value & > (Json::Value &pJson) |
| template<> | |
| HttpResponsePtr | toResponse< const Json::Value & > (const Json::Value &pJson) |
| template<> | |
| HttpResponsePtr | toResponse (Json::Value &&pJson) |
| template<> | |
| std::shared_ptr< Json::Value > | fromResponse (const HttpResponse &resp) |
| std::string_view | to_string_view (drogon::ReqResult result) |
| std::string | to_string (drogon::ReqResult result) |
| std::ostream & | operator<< (std::ostream &out, drogon::ReqResult result) |
| trantor::LogStream & | operator<< (trantor::LogStream &out, drogon::ReqResult result) |
| std::string_view | to_string_view (drogon::HttpMethod method) |
| std::string | to_string (drogon::HttpMethod method) |
| trantor::EventLoop * | getIOThreadStorageLoop (size_t index) noexcept(false) |
| RateLimiterType | stringToRateLimiterType (const std::string &type) |
| template<typename Await> | |
| auto | sync_wait (Await &&await) |
| template<typename Await> | |
| auto | co_future (Await &&await) noexcept -> std::future< await_result_t< Await > > |
| internal::TimerAwaiter | sleepCoro (trantor::EventLoop *loop, const std::chrono::duration< double > &delay) noexcept |
| internal::TimerAwaiter | sleepCoro (trantor::EventLoop *loop, double delay) noexcept |
| internal::LoopAwaiter | queueInLoopCoro (trantor::EventLoop *workLoop, std::function< void()> taskFunc, trantor::EventLoop *resumeLoop=nullptr) |
| internal::SwitchThreadAwaiter | switchThreadCoro (trantor::EventLoop *loop) noexcept |
| internal::EndAwaiter | untilQuit (trantor::EventLoop *loop) |
| template<typename Coro> | |
| void | async_run (Coro &&coro) |
| Runs a coroutine from a regular function. | |
| template<typename Coro> | |
| std::function< void()> | async_func (Coro &&coro) |
| returns a function that calls a coroutine | |
| template<typename T> | |
| internal::EventLoopAwaiter< T > | queueInLoopCoro (trantor::EventLoop *loop, std::function< T()> task) |
| Run a task in a given event loop and returns a resumable object that can be co_awaited in a coroutine. | |
| template<typename... Tasks> | |
| internal::WhenAllAwaiter< Tasks... > | when_all (Tasks... tasks) |
| template<typename T> | |
| internal::WhenAllAwaiter< std::vector< Task< T > > > | when_all (std::vector< Task< T > > tasks) |
| internal::WhenAllAwaiter< std::vector< Task< void > > > | when_all (std::vector< Task< void > > tasks) |
| DROGON_EXPORT const std::string_view & | statusCodeToString (int code) |
| Get the HTTP messages corresponding to the HTTP status codes. | |
Variables | |
| template<typename T> | |
| DrObject< T >::DrAllocator | DrObject< T >::alloc_ |
| const char | banner [] |
| template<typename T, bool AutoCreation> | |
| HttpController< T, AutoCreation >::methodRegistrator | HttpController< T, AutoCreation >::registrator_ |
| template<typename T, bool AutoCreation> | |
| HttpSimpleController< T, AutoCreation >::pathRegistrator | HttpSimpleController< T, AutoCreation >::registrator_ |
| template<typename T, bool AutoCreation> | |
| WebSocketController< T, AutoCreation >::pathRegistrator | WebSocketController< T, AutoCreation >::registrator_ |
| class DROGON_EXPORT | RateLimiter |
| template<typename T> | |
| constexpr bool | is_awaitable_v = is_awaitable<T>::value |
| template<typename T> | |
| constexpr bool | is_resumable_v = is_resumable<T>::value |
Drogon Test is a minimal effort test framework developed because the major C++ test frameworks doesn't handle async programs well. Drogon Test's syntax is inspired by both Google Test and Catch2.
Attribute.h armst.nosp@m.rong.nosp@m.@swee.nosp@m.lia..nosp@m.com
Copyright 2018, An Tao. All rights reserved. https://github.com/an-tao/drogon Use of this source code is governed by a MIT license that can be found in the License file.
Drogon
DrTemplate.h An Tao
Copyright 2018, An Tao. All rights reserved. https://github.com/an-tao/drogon Use of this source code is governed by a MIT license that can be found in the License file.
Drogon
The classes in the file are internal tool classes. Do not include this file directly and use any of these classes directly.
UploadFile.h An Tao
Copyright 2018, An Tao. All rights reserved. https://github.com/an-tao/drogon Use of this source code is governed by a MIT license that can be found in the License file.
Drogon
drogon_callbacks.h An Tao
Copyright 2018, An Tao. All rights reserved. https://github.com/an-tao/drogon Use of this source code is governed by a MIT license that can be found in the License file.
Drogon
FunctionTraits.h An Tao
Copyright 2018, An Tao. All rights reserved. https://github.com/an-tao/drogon Use of this source code is governed by a MIT license that can be found in the License file.
Drogon
HttpConstraint.h An Tao
Copyright 2018, An Tao. All rights reserved. https://github.com/an-tao/drogon Use of this source code is governed by a MIT license that can be found in the License file.
Drogon
OStringStream.h An Tao
Copyright 2018, An Tao. All rights reserved. https://github.com/an-tao/drogon Use of this source code is governed by a MIT license that can be found in the License file.
Drogon
ResultIterator.h An Tao
Copyright 2018, An Tao. All rights reserved. https://github.com/an-tao/drogon Use of this source code is governed by a MIT license that can be found in the License file.
Drogon
RowIterator.h An Tao
Copyright 2018, An Tao. All rights reserved. https://github.com/an-tao/drogon Use of this source code is governed by a MIT license that can be found in the License file.
Drogon
| using drogon::DefaultHandler |
| using drogon::ExceptionHandler |
| using drogon::MiddlewareNextCallback |
| using drogon::SafeStringMap |
| using drogon::WebSocketRequestCallback |
| std::function< void()> drogon::async_func | ( | Coro && | coro | ) |
returns a function that calls a coroutine
| coro | A coroutine that is awaitable |
| void drogon::async_run | ( | Coro && | coro | ) |
Runs a coroutine from a regular function.
| coro | A coroutine that is awaitable |
| DROGON_EXPORT const std::string_view & drogon::statusCodeToString | ( | int | code | ) |
Get the HTTP messages corresponding to the HTTP status codes.
| code | HTTP status code |
| const char drogon::banner[] |