-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91a4a3e
commit 3669223
Showing
12 changed files
with
66 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef IPFS_CHROMIUM_HTTP_API_H | ||
#define IPFS_CHROMIUM_HTTP_API_H | ||
|
||
#include <ipfs_client/http_request_description.h> | ||
#include <functional> | ||
|
||
namespace ipfs::ctx { | ||
class HttpApi { | ||
public: | ||
using HttpRequestDescription = ::ipfs::HttpRequestDescription; | ||
using HeaderAccess = std::function<std::string(std::string_view)>; | ||
using HttpCompleteCallback = | ||
std::function<void(std::int16_t, std::string_view, HeaderAccess)>; | ||
virtual void SendHttpRequest(HttpRequestDescription, | ||
HttpCompleteCallback cb) const = 0; | ||
}; | ||
} // namespace ipfs::ctx | ||
|
||
#endif // IPFS_CHROMIUM_HTTP_API_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "null_http_provider.h" | ||
|
||
using Self = ipfs::ctx::NullHttpProvider; | ||
|
||
void Self::SendHttpRequest(HttpRequestDescription, | ||
HttpCompleteCallback cb) const { | ||
auto hdrs = [](auto) { return std::string{}; }; | ||
cb(500, "No HTTP networking available.", hdrs); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef IPFS_CHROMIUM_NULLHTTPPROVIDER_H | ||
#define IPFS_CHROMIUM_NULLHTTPPROVIDER_H | ||
|
||
#include <ipfs_client/ctx/http_api.h> | ||
|
||
namespace ipfs::ctx { | ||
class NullHttpProvider : public HttpApi { | ||
void SendHttpRequest(HttpRequestDescription, HttpCompleteCallback cb) const; | ||
}; | ||
} // namespace ipfs::ctx | ||
|
||
#endif // IPFS_CHROMIUM_NULLHTTPPROVIDER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters