Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
s3-url.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/util/configuration.hh
"
5
#include "
nix/util/error.hh
"
6
#include "
nix/util/url.hh
"
7
#include "
nix/util/util.hh
"
8
9
#include <optional>
10
#include <string>
11
#include <string_view>
12
#include <variant>
13
#include <vector>
14
15
namespace
nix {
16
23
enum class
S3AddressingStyle
{
24
Auto
,
25
Path,
26
Virtual,
27
};
28
29
MakeError(InvalidS3AddressingStyle, Error);
30
31
S3AddressingStyle parseS3AddressingStyle(std::string_view style);
32
std::string_view showS3AddressingStyle(S3AddressingStyle style);
33
34
NIX_DECLARE_CONFIG_SERIALISER(S3AddressingStyle)
35
36
39
struct
ParsedS3URL
40
{
41
std::string bucket;
47
std::vector<std::string>
key
;
48
std::optional<std::string> profile;
49
std::optional<std::string> region;
50
std::optional<std::string> scheme;
51
std::optional<std::string> versionId;
52
std::optional<S3AddressingStyle> addressingStyle;
57
std::variant<std::monostate, ParsedURL, ParsedURL::Authority>
endpoint
;
58
59
std::optional<std::string> getEncodedEndpoint()
const
60
{
61
return
std::visit(
62
overloaded
{
63
[](std::monostate) -> std::optional<std::string> {
return
std::nullopt; },
64
[](
const
auto
& authorityOrUrl) -> std::optional<std::string> {
return
authorityOrUrl.to_string(); },
65
},
66
endpoint
);
67
}
68
69
static
ParsedS3URL
parse(
const
ParsedURL
& uri);
70
75
ParsedURL
toHttpsUrl()
const
;
76
77
auto
operator<=>(
const
ParsedS3URL
& other)
const
=
default
;
78
};
79
80
}
// namespace nix
configuration.hh
error.hh
This file defines two main structs/classes used in nix error handling.
nix::S3AddressingStyle
S3AddressingStyle
Definition
s3-url.hh:23
nix::Auto
Definition
store-reference.hh:53
nix::ParsedS3URL
Definition
s3-url.hh:40
nix::ParsedS3URL::key
std::vector< std::string > key
Definition
s3-url.hh:47
nix::ParsedS3URL::endpoint
std::variant< std::monostate, ParsedURL, ParsedURL::Authority > endpoint
Definition
s3-url.hh:57
nix::ParsedURL
Definition
url.hh:22
nix::overloaded
Definition
util.hh:444
url.hh
util.hh
libstore
include
nix
store
s3-url.hh
Generated by
1.18.0