Add support for bucket name in Sia provider #16
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
2024-09-28 09:52:57 -05:00
parent 692c92b0df
commit aa92f3d401
5 changed files with 44 additions and 23 deletions

View File

@ -98,6 +98,7 @@ private:
std::string cache_directory_;
host_config hc_;
s3_config s3_config_;
sia_config sia_config_{"default"};
std::uint64_t version_{REPERTORY_CONFIG_VERSION};
std::string log_directory_;
mutable std::recursive_mutex read_write_mutex_;
@ -295,6 +296,10 @@ public:
[[nodiscard]] auto get_s3_config() const -> s3_config { return s3_config_; }
[[nodiscard]] auto get_sia_config() const -> sia_config {
return sia_config_;
}
[[nodiscard]] auto get_value_by_name(const std::string &name) -> std::string;
[[nodiscard]] auto get_version() const -> std::uint64_t { return version_; }

View File

@ -270,7 +270,6 @@ from_json(const json &j, host_config &hc) {
struct s3_config final {
std::string access_key{};
std::string bucket{};
std::uint16_t cache_timeout_secs{60U};
std::string encryption_token{};
std::string region{"any"};
std::string secret_key{};
@ -280,6 +279,10 @@ struct s3_config final {
bool use_region_in_url{false};
};
struct sia_config final {
std::string bucket{};
};
using api_file_list = std::vector<api_file>;
using api_file_provider_callback = std::function<void(api_file &)>;
using api_item_added_callback = std::function<api_error(bool, api_file &)>;