ipfs-chromium
multi_gateway_requestor.h
1 #ifndef IPFS_MULTI_GATEWAY_REQUESTOR_H_
2 #define IPFS_MULTI_GATEWAY_REQUESTOR_H_
3 
4 #include "gateway_state.h"
5 
6 #include <ipfs_client/gw/requestor.h>
7 
8 #include <ipfs_client/client.h>
9 
10 #include <chrono>
11 #include <deque>
12 #include <map>
13 
14 namespace ipfs::gw {
18  std::map<std::string, GatewayState> state_;
19  std::deque<RequestPtr> q;
20  bool Process(RequestPtr const&);
21  void DoSend(RequestPtr, std::string const&, GatewayState&);
22  using HeaderAccess = ctx::HttpApi::Hdrs;
23  void HandleResponse(HttpRequestDescription const&,
24  RequestPtr,
25  std::string const&,
26  std::int16_t,
27  std::string_view,
28  HeaderAccess,
29  bool,
30  std::chrono::system_clock::time_point);
31  void Next();
32 
33  public:
36  std::string_view name() const override;
37  HandleOutcome handle(RequestPtr) override;
38 };
39 } // namespace ipfs::gw
40 
41 #endif // IPFS_MULTI_GATEWAY_REQUESTOR_H_
Definition: gateway_state.h:25
Definition: multi_gateway_requestor.h:17
std::string_view name() const override
Definition: requestor.h:22
Definition: http_request_description.h:12