ipfs-chromium
Loading...
Searching...
No Matches
opinionated_context.h
1#ifndef IPFS_OPINIONATED_CONTEXT_H_
2#define IPFS_OPINIONATED_CONTEXT_H_
3
4#include <ipfs_client/ctx/ares_dns_txt_lookup.h>
5#include <ipfs_client/ctx/boost_beast_http.h>
6
7#include <ipfs_client/crypto/openssl_signature_verifier.h>
8
9#include <ipfs_client/client.h>
10#include <ipfs_client/partition.h>
11
12#include <memory>
13
14#if HAS_BOOST_BEAST && HAS_ARES && HAS_OPENSSL_EVP
15
16#define HAS_OPINIONATED_CONTEXT 1
17
18#include <google/protobuf/stubs/logging.h>
19
20namespace boost::asio {
21class io_context;
22}
23
24#pragma GCC diagnostic push
25#pragma GCC diagnostic ignored "-Wunused-variable"
26namespace google::protobuf {
27 namespace {
28 LogLevel LOGLEVEL_DEBUG = static_cast<LogLevel>(-1);
29 LogLevel LOGLEVEL_TRACE = static_cast<LogLevel>(-2);
30 }
31} // namespace google::protobuf
32#pragma GCC diagnostic pop
33
34class HttpSession;
35
36namespace ipfs {
37
38// std::pair<std::shared_ptr<ContextApi>, std::shared_ptr<Partition>>
39std::shared_ptr<Client> start_default(boost::asio::io_context& io);
40
41} // namespace ipfs
42
43#elif defined(_MSC_VER)
44#pragma message("Not ported to MSVC")
45#else
46#warning \
47 "You are missing dependencies necessary for using the opinionated context."
48#endif // HAS_BOOST_BEAST && HAS_ARES && HAS_OPENSSL_EVP
49
50#endif // IPFS_OPINIONATED_CONTEXT_H_