ipfs-chromium
|
Interface that provides functionality from whatever environment you're using this library in. More...
#include <include/ipfs_client/client.h>
Public Types | |
using | SigningKeyType = ::ipfs::crypto::SigningKeyType |
using | MimeTypeDeduction = std::function< std::string(std::string, std::string_view, std::string const &)> |
using | UrlUnescaping = std::function< std::string(std::string_view)> |
using | DnslinkFallbackSwitch = std::function< bool()> |
using | ByteView = ::ipfs::ByteView |
Public Member Functions | |
std::shared_ptr< Partition > | partition (std::string key) |
ctx::HttpApi & | http () |
ctx::DnsTxtLookup & | dns_txt () |
ctx::GatewayConfig & | gw_cfg () |
ctx::JsonParser & | json () |
ctx::CborParser & | cbor () |
std::shared_ptr< gw::Requestor > | requestor () |
Client & | with (std::unique_ptr< ctx::HttpApi >) |
Client & | with (std::unique_ptr< ctx::DnsTxtLookup >) |
Client & | with (std::unique_ptr< ctx::GatewayConfig >) |
Client & | with (std::unique_ptr< ctx::JsonParser >) |
Client & | with (std::unique_ptr< ctx::CborParser >) |
Client & | with (std::shared_ptr< gw::Requestor >) |
Client & | with (SigningKeyType, std::unique_ptr< crypto::SignatureVerifier >) |
Client & | with (MimeTypeDeduction) |
Client & | with (UrlUnescaping) |
Client & | with (DnslinkFallbackSwitch) |
std::string | MimeType (std::string extension, std::string_view content, std::string const &url) |
Determine a mime type for a given file. | |
std::string | UnescapeUrlComponent (std::string_view url_comp) |
Remove URL escaping, e.g. %20. | |
bool | VerifyKeySignature (SigningKeyType, ByteView signature, ByteView data, ByteView key_bytes) const |
std::optional< std::vector< Byte > > | Hash (HashType, ByteView data) |
bool | DnslinkFallback () const |
Protected Attributes | |
std::unordered_map< HashType, std::unique_ptr< crypto::Hasher > > | hashers_ |
std::unordered_map< SigningKeyType, std::unique_ptr< crypto::SignatureVerifier > > | verifiers_ |
std::unique_ptr< ctx::HttpApi > | http_api_ |
std::unique_ptr< ctx::DnsTxtLookup > | dns_txt_ |
std::unique_ptr< ctx::GatewayConfig > | gateway_config_ |
std::unique_ptr< ctx::JsonParser > | json_parser_ |
std::unique_ptr< ctx::CborParser > | cbor_parser_ |
MimeTypeDeduction | deduce_mime_type_ |
UrlUnescaping | unescape_ |
std::shared_ptr< gw::Requestor > | rtor_ |
std::unordered_map< std::string, std::shared_ptr< Partition > > | partitions_ |
DnslinkFallbackSwitch | dns_fb_ |
Interface that provides functionality from whatever environment you're using this library in.
std::string ipfs::Client::MimeType | ( | std::string | extension, |
std::string_view | content, | ||
std::string const & | url | ||
) |
Determine a mime type for a given file.
extension | - "File extension" not including ., e.g. "html" |
content | - The content of the resource or a large prefix thereof |
url | - A URL it was fetched from (of any sort, ipfs:// is fine) |
std::string ipfs::Client::UnescapeUrlComponent | ( | std::string_view | url_comp | ) |
Remove URL escaping, e.g. %20.
url_comp | - a single component of the URL, e.g. a element of the path not including / |