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> {
20 using MimeDetection = std::function<
21 std::string(std::string, std::string_view, std::string
const&)>;
22 void build_response(std::shared_ptr<IpfsRequest>);
23 bool add_node(std::string key, ipld::NodePtr);
24 bool has_key(std::string
const& k)
const;
25 std::size_t Stored()
const {
return dags_.size(); }
27 explicit Partition(std::shared_ptr<gw::Requestor> requestor,
28 std::shared_ptr<Client>);
31 flat_map<std::string, ipld::NodePtr> dags_;
32 std::shared_ptr<Client> api_;
33 std::shared_ptr<gw::Requestor> requestor_;
35 void from_tree(std::shared_ptr<IpfsRequest>,
39 bool gw_request(std::shared_ptr<IpfsRequest>,
41 std::string
const& aff);
Definition: partition.h:18
Definition: slash_delimited.h:15