1#ifndef IPFS_CHROMIUM_MOCK_GW_CFG_H
2#define IPFS_CHROMIUM_MOCK_GW_CFG_H
4#include <ipfs_client/ctx/gateway_config.h>
13 std::vector<i::GatewaySpec> index_gettable_gateways;
14 std::optional<i::GatewaySpec> GetGateway(std::size_t i)
const {
15 if (i < index_gettable_gateways.size()) {
16 return index_gettable_gateways.at(i);
20 unsigned GetGatewayRate(std::string_view) {
return 120U; }
21 std::vector<std::string> gateways_added;
22 void AddGateway(std::string_view g) { gateways_added.emplace_back(g); }
23 void AddGateway(std::string_view g,
unsigned) {
24 gateways_added.emplace_back(g);
26 void SetGatewayRate(std::string_view,
unsigned int)
override {}
27 unsigned RoutingApiDiscoveryDefaultRate()
const {
return 9; }
28 virtual ~MockGwCfg() noexcept
override {}
29 bool http_disc_ =
true;
30 bool RoutingApiDiscoveryOfUnencryptedGateways()
const {
return http_disc_; }
31 int GetTypeAffinity(std::string_view url_prefix,
32 ig::GatewayRequestType)
const {
35 void SetTypeAffinity(std::string_view url_prefix,
36 ig::GatewayRequestType,
Definition gateway_config.h:13