aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/IO/S3/URI.h
blob: 9df075c732274d6704f230d21edbdff64f293f3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include <string>

#include "clickhouse_config.h"

#if USE_AWS_S3

#include <Poco/URI.h>

namespace DB::S3
{

/**
 * Represents S3 URI.
 *
 * The following patterns are allowed:
 * s3://bucket/key
 * http(s)://endpoint/bucket/key
 */
struct URI
{
    Poco::URI uri;
    // Custom endpoint if URI scheme is not S3.
    std::string endpoint;
    std::string bucket;
    std::string key;
    std::string version_id;
    std::string storage_name;

    bool is_virtual_hosted_style;

    URI() = default;
    explicit URI(const std::string & uri_);

    static void validateBucket(const std::string & bucket, const Poco::URI & uri);
};

}

#endif