ClickHouse/src/IO/S3Settings.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
871 B
C++
Raw Normal View History

2024-05-25 16:46:07 +00:00
#pragma once
#include <map>
#include <mutex>
#include <optional>
#include <base/types.h>
#include <Interpreters/Context_fwd.h>
#include <Common/Throttler_fwd.h>
#include <IO/S3Common.h>
#include <IO/S3Defines.h>
namespace Poco::Util { class AbstractConfiguration; }
namespace DB
{
struct Settings;
struct S3Settings
{
S3::AuthSettings auth_settings;
S3::RequestSettings request_settings;
};
class S3SettingsByEndpoint
{
public:
void loadFromConfig(
const Poco::Util::AbstractConfiguration & config,
const std::string & config_prefix,
const DB::Settings & settings);
std::optional<S3Settings> getSettings(
const std::string & endpoint,
const std::string & user,
bool ignore_user = false) const;
private:
mutable std::mutex mutex;
std::map<const String, const S3Settings> s3_settings;
};
}