ipfs-chromium
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ipfs::gw::GatewayRequest Class Reference

#include <library/include/ipfs_client/gw/gateway_request.h>

Inheritance diagram for ipfs::gw::GatewayRequest:
Inheritance graph
[legend]
Collaboration diagram for ipfs::gw::GatewayRequest:
Collaboration graph
[legend]

Public Types

using BytesReceivedHook = std::function< void(std::string_view, ByteView, ipld::BlockSource const &)>
 

Public Member Functions

std::optional< Cid > const & cid () const
 
void cid (Cid c)
 
std::string url_suffix () const
 
std::string_view accept () const
 
std::string_view identity_data () const
 
short timeout_seconds () const
 
bool is_http () const
 
std::optional< std::size_t > max_response_size () const
 
std::optional< HttpRequestDescriptiondescribe_http (std::string_view) const
 
std::string debug_string () const
 
void orchestrator (std::shared_ptr< Partition > const &)
 
bool cachable () const
 
std::string_view root_component () const
 
void root_component (std::string_view)
 
bool RespondSuccessfully (std::string_view, std::shared_ptr< Client > const &api, ipld::BlockSource src, std::string_view roots="", bool *valid=nullptr)
 
void Hook (BytesReceivedHook)
 
bool PartiallyRedundant () const
 
std::string Key () const
 
bool Finished () const
 

Static Public Member Functions

static std::shared_ptr< GatewayRequestfromIpfsPath (SlashDelimited ipfs_path)
 

Public Attributes

GatewayRequestType type = GatewayRequestType::Zombie
 
std::string path
 For CAR requests.
 
std::shared_ptr< IpfsRequestdependent
 
short parallel = 0
 
std::string affinity
 
std::unordered_set< std::string > failures
 

Detailed Description

Information about a request that needs to be sent to an IPFS HTTP Gateway

Todo:
this class has gotten large enough that it should probably be a base class with subclasses instead of switch statements on type

Member Typedef Documentation

◆ BytesReceivedHook

using ipfs::gw::GatewayRequest::BytesReceivedHook = std::function<void(std::string_view, ByteView, ipld::BlockSource const&)>

Type for callbacks for when bytes are received

Member Function Documentation

◆ root_component()

std::string_view ipfs::gw::GatewayRequest::root_component ( ) const
Returns
The part of the path that functions as an origin (the second component)

The documentation for this class was generated from the following file: