1 #ifndef IPFS_ORCHESTRATOR_H_
2 #define IPFS_ORCHESTRATOR_H_
4 #include "ipfs_client/ipld/dag_node.h"
6 #include <ipfs_client/gw/requestor.h>
7 #include <vocab/flat_mapset.h>
18 class Partition :
public std::enable_shared_from_this<Partition> {
21 std::function<void(std::shared_ptr<gw::GatewayRequest>)>;
22 using MimeDetection = std::function<
23 std::string(std::string, std::string_view, std::string
const&)>;
24 void build_response(std::shared_ptr<IpfsRequest>);
25 bool add_node(std::string key, ipld::NodePtr);
26 bool has_key(std::string
const& k)
const;
27 std::size_t Stored()
const {
return dags_.size(); }
29 explicit Partition(std::shared_ptr<gw::Requestor> requestor,
30 std::shared_ptr<Client>);
33 flat_map<std::string, ipld::NodePtr> dags_;
34 std::shared_ptr<Client> api_;
35 std::shared_ptr<gw::Requestor> requestor_;
37 void from_tree(std::shared_ptr<IpfsRequest>,
41 bool gw_request(std::shared_ptr<IpfsRequest>,
43 std::string
const& aff);
Definition: partition.h:18
Definition: slash_delimited.h:15