18class 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);