|
24 | 24 | #include <string> |
25 | 25 | #include <thread> |
26 | 26 | #include <unordered_map> |
| 27 | +#include <variant> |
27 | 28 | #include <vector> |
28 | 29 |
|
29 | 30 | namespace vcpkg |
@@ -131,42 +132,77 @@ namespace vcpkg |
131 | 132 | std::string feed; |
132 | 133 | }; |
133 | 134 |
|
134 | | - struct BinaryConfigParserState |
| 135 | + struct FilesBinaryProviderConfig |
135 | 136 | { |
136 | | - bool nuget_interactive = false; |
137 | | - std::set<StringLiteral> binary_cache_providers; |
138 | | - |
139 | | - std::string nugettimeout = "100"; |
140 | | - |
141 | 137 | std::vector<Path> archives_to_read; |
142 | 138 | std::vector<Path> archives_to_write; |
| 139 | + }; |
143 | 140 |
|
| 141 | + struct HttpBinaryProviderConfig |
| 142 | + { |
| 143 | + std::vector<std::string> secrets; |
144 | 144 | std::vector<UrlTemplate> url_templates_to_get; |
145 | 145 | std::vector<UrlTemplate> url_templates_to_put; |
| 146 | + }; |
146 | 147 |
|
| 148 | + struct GcsBinaryProviderConfig |
| 149 | + { |
147 | 150 | std::vector<std::string> gcs_read_prefixes; |
148 | 151 | std::vector<std::string> gcs_write_prefixes; |
| 152 | + }; |
149 | 153 |
|
| 154 | + struct AwsBinaryProviderConfig |
| 155 | + { |
150 | 156 | std::vector<std::string> aws_read_prefixes; |
151 | 157 | std::vector<std::string> aws_write_prefixes; |
152 | | - bool aws_no_sign_request = false; |
| 158 | + }; |
153 | 159 |
|
| 160 | + struct CosBinaryProviderConfig |
| 161 | + { |
154 | 162 | std::vector<std::string> cos_read_prefixes; |
155 | 163 | std::vector<std::string> cos_write_prefixes; |
| 164 | + }; |
156 | 165 |
|
| 166 | + struct GhaBinaryProviderConfig |
| 167 | + { |
157 | 168 | bool gha_write = false; |
158 | 169 | bool gha_read = false; |
| 170 | + }; |
159 | 171 |
|
160 | | - std::vector<AzureUpkgSource> upkg_templates_to_get; |
161 | | - std::vector<AzureUpkgSource> upkg_templates_to_put; |
162 | | - |
| 172 | + struct NugetBinaryProviderConfig |
| 173 | + { |
163 | 174 | std::vector<std::string> sources_to_read; |
164 | 175 | std::vector<std::string> sources_to_write; |
165 | 176 |
|
166 | 177 | std::vector<Path> configs_to_read; |
167 | 178 | std::vector<Path> configs_to_write; |
| 179 | + }; |
168 | 180 |
|
169 | | - std::vector<std::string> secrets; |
| 181 | + struct AzureUpkgBinaryProviderConfig |
| 182 | + { |
| 183 | + std::vector<AzureUpkgSource> upkg_templates_to_get; |
| 184 | + std::vector<AzureUpkgSource> upkg_templates_to_put; |
| 185 | + }; |
| 186 | + |
| 187 | + using BinaryProviderConfig = std::variant<FilesBinaryProviderConfig, |
| 188 | + HttpBinaryProviderConfig, |
| 189 | + GcsBinaryProviderConfig, |
| 190 | + AwsBinaryProviderConfig, |
| 191 | + CosBinaryProviderConfig, |
| 192 | + GhaBinaryProviderConfig, |
| 193 | + NugetBinaryProviderConfig, |
| 194 | + AzureUpkgBinaryProviderConfig>; |
| 195 | + |
| 196 | + struct BinaryConfigParserState |
| 197 | + { |
| 198 | + bool nuget_interactive = false; |
| 199 | + std::set<StringLiteral> binary_cache_providers; |
| 200 | + |
| 201 | + std::vector<BinaryProviderConfig> binary_providers; |
| 202 | + |
| 203 | + std::string nugettimeout = "100"; |
| 204 | + |
| 205 | + bool aws_no_sign_request = false; |
170 | 206 |
|
171 | 207 | // These are filled in after construction by reading from args and environment |
172 | 208 | std::string nuget_prefix; |
|
0 commit comments