ipfs-chromium
transitory_gateway_config.h
1 #ifndef IPFS_CHROMIUM_TRANSITORY_GATEWAY_CONFIG_H
2 #define IPFS_CHROMIUM_TRANSITORY_GATEWAY_CONFIG_H
3 
4 #include "gateway_config.h"
5 
6 #include <vector>
7 
8 namespace ipfs::ctx {
12  std::vector<GatewaySpec> gateways_;
13 
14  std::vector<GatewaySpec>::iterator FindGateway(std::string_view);
15 
16  public:
17  /* @param index 0-based index into list
18  * @return The spec at index, or nullopt if index is out-of-bounds
19  */
20  std::optional<GatewaySpec> GetGateway(std::size_t index) const override;
21  unsigned GetGatewayRate(std::string_view) override;
22  void SetGatewayRate(std::string_view, unsigned) override;
23  void AddGateway(std::string_view, unsigned) override;
24  unsigned RoutingApiDiscoveryDefaultRate() const override;
25  bool RoutingApiDiscoveryOfUnencryptedGateways() const override;
26  int GetTypeAffinity(std::string_view url_prefix,
27  gw::GatewayRequestType) const override;
28  void SetTypeAffinity(std::string_view url_prefix,
29  gw::GatewayRequestType,
30  int) override;
31 
35 };
36 } // namespace ipfs::ctx
37 
38 #endif // IPFS_CHROMIUM_TRANSITORY_GATEWAY_CONFIG_H
Definition: gateway_config.h:13
Definition: transitory_gateway_config.h:11
std::optional< GatewaySpec > GetGateway(std::size_t index) const override