xds_api/generated/xds.core.v3.rs
1// This file is @generated by prost-build.
2/// Message type for extension configuration.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct TypedExtensionConfig {
5 /// The name of an extension. This is not used to select the extension, instead
6 /// it serves the role of an opaque identifier.
7 #[prost(string, tag = "1")]
8 pub name: ::prost::alloc::string::String,
9 /// The typed config for the extension. The type URL will be used to identify
10 /// the extension. In the case that the type URL is *xds.type.v3.TypedStruct*
11 /// (or, for historical reasons, *udpa.type.v1.TypedStruct*), the inner type
12 /// URL of *TypedStruct* will be utilized. See the
13 /// :ref:`extension configuration overview
14 /// <config_overview_extension_configuration>` for further details.
15 #[prost(message, optional, tag = "2")]
16 pub typed_config: ::core::option::Option<super::super::super::google::protobuf::Any>,
17}
18impl ::prost::Name for TypedExtensionConfig {
19 const NAME: &'static str = "TypedExtensionConfig";
20 const PACKAGE: &'static str = "xds.core.v3";
21 fn full_name() -> ::prost::alloc::string::String {
22 "xds.core.v3.TypedExtensionConfig".into()
23 }
24 fn type_url() -> ::prost::alloc::string::String {
25 "/xds.core.v3.TypedExtensionConfig".into()
26 }
27}
28/// Additional parameters that can be used to select resource variants. These include any
29/// global context parameters, per-resource type client feature capabilities and per-resource
30/// type functional attributes. All per-resource type attributes will be `xds.resource.`
31/// prefixed and some of these are documented below:
32///
33/// `xds.resource.listening_address`: The value is "IP:port" (e.g. "10.1.1.3:8080") which is
34/// the listening address of a Listener. Used in a Listener resource query.
35#[derive(Clone, PartialEq, ::prost::Message)]
36pub struct ContextParams {
37 #[prost(map = "string, string", tag = "1")]
38 pub params: ::std::collections::HashMap<
39 ::prost::alloc::string::String,
40 ::prost::alloc::string::String,
41 >,
42}
43impl ::prost::Name for ContextParams {
44 const NAME: &'static str = "ContextParams";
45 const PACKAGE: &'static str = "xds.core.v3";
46 fn full_name() -> ::prost::alloc::string::String {
47 "xds.core.v3.ContextParams".into()
48 }
49 fn type_url() -> ::prost::alloc::string::String {
50 "/xds.core.v3.ContextParams".into()
51 }
52}
53/// xDS authority information.
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct Authority {
56 #[prost(string, tag = "1")]
57 pub name: ::prost::alloc::string::String,
58}
59impl ::prost::Name for Authority {
60 const NAME: &'static str = "Authority";
61 const PACKAGE: &'static str = "xds.core.v3";
62 fn full_name() -> ::prost::alloc::string::String {
63 "xds.core.v3.Authority".into()
64 }
65 fn type_url() -> ::prost::alloc::string::String {
66 "/xds.core.v3.Authority".into()
67 }
68}
69/// xDS resource locators identify a xDS resource name and instruct the
70/// data-plane load balancer on how the resource may be located.
71///
72/// Resource locators have a canonical xdstp:// URI representation:
73///
74/// xdstp://{authority}/{type_url}/{id}?{context_params}{#directive,*}
75///
76/// where context_params take the form of URI query parameters.
77///
78/// Resource locators have a similar canonical http:// URI representation:
79///
80/// <http://{authority}/{type_url}/{id}?{context_params}{#directive,*}>
81///
82/// Resource locators also have a simplified file:// URI representation:
83///
84/// file:///{id}{#directive,*}
85///
86#[derive(Clone, PartialEq, ::prost::Message)]
87pub struct ResourceLocator {
88 /// URI scheme.
89 #[prost(enumeration = "resource_locator::Scheme", tag = "1")]
90 pub scheme: i32,
91 /// Opaque identifier for the resource. Any '/' will not be escaped during URI
92 /// encoding and will form part of the URI path. This may end
93 /// with ‘*’ for glob collection references.
94 #[prost(string, tag = "2")]
95 pub id: ::prost::alloc::string::String,
96 /// Logical authority for resource (not necessarily transport network address).
97 /// Authorities are opaque in the xDS API, data-plane load balancers will map
98 /// them to concrete network transports such as an xDS management server, e.g.
99 /// via envoy.config.core.v3.ConfigSource.
100 #[prost(string, tag = "3")]
101 pub authority: ::prost::alloc::string::String,
102 /// Fully qualified resource type (as in type URL without types.googleapis.com/
103 /// prefix).
104 #[prost(string, tag = "4")]
105 pub resource_type: ::prost::alloc::string::String,
106 /// A list of directives that appear in the xDS resource locator #fragment.
107 ///
108 /// When encoding to URI form, directives are percent encoded with comma
109 /// separation.
110 #[prost(message, repeated, tag = "6")]
111 pub directives: ::prost::alloc::vec::Vec<resource_locator::Directive>,
112 #[prost(oneof = "resource_locator::ContextParamSpecifier", tags = "5")]
113 pub context_param_specifier: ::core::option::Option<
114 resource_locator::ContextParamSpecifier,
115 >,
116}
117/// Nested message and enum types in `ResourceLocator`.
118pub mod resource_locator {
119 /// Directives provide information to data-plane load balancers on how xDS
120 /// resource names are to be interpreted and potentially further resolved. For
121 /// example, they may provide alternative resource locators for when primary
122 /// resolution fails. Directives are not part of resource names and do not
123 /// appear in a xDS transport discovery request.
124 ///
125 /// When encoding to URIs, directives take the form:
126 ///
127 /// <directive name>=<string representation of directive value>
128 ///
129 /// For example, we can have alt=xdstp://foo/bar or entry=some%20thing. Each
130 /// directive value type may have its own string encoding, in the case of
131 /// ResourceLocator there is a recursive URI encoding.
132 ///
133 /// Percent encoding applies to the URI encoding of the directive value.
134 /// Multiple directives are comma-separated, so the reserved characters that
135 /// require percent encoding in a directive value are \[',', '#', '[', '\]',
136 /// '%']. These are the RFC3986 fragment reserved characters with the addition
137 /// of the xDS scheme specific ','. See
138 /// <https://tools.ietf.org/html/rfc3986#page-49> for further details on URI ABNF
139 /// and reserved characters.
140 #[derive(Clone, PartialEq, ::prost::Message)]
141 pub struct Directive {
142 #[prost(oneof = "directive::Directive", tags = "1, 2")]
143 pub directive: ::core::option::Option<directive::Directive>,
144 }
145 /// Nested message and enum types in `Directive`.
146 pub mod directive {
147 #[derive(Clone, PartialEq, ::prost::Oneof)]
148 pub enum Directive {
149 /// An alternative resource locator for fallback if the resource is
150 /// unavailable. For example, take the resource locator:
151 ///
152 /// xdstp://foo/some-type/some-route-table#alt=xdstp://bar/some-type/another-route-table
153 ///
154 /// If the data-plane load balancer is unable to reach `foo` to fetch the
155 /// resource, it will fallback to `bar`. Alternative resources do not need
156 /// to have equivalent content, but they should be functional substitutes.
157 #[prost(message, tag = "1")]
158 Alt(super::super::ResourceLocator),
159 /// List collections support inlining of resources via the entry field in
160 /// Resource. These inlined Resource objects may have an optional name
161 /// field specified. When specified, the entry directive allows
162 /// ResourceLocator to directly reference these inlined resources, e.g.
163 /// xdstp://.../foo#entry=bar.
164 #[prost(string, tag = "2")]
165 Entry(::prost::alloc::string::String),
166 }
167 }
168 impl ::prost::Name for Directive {
169 const NAME: &'static str = "Directive";
170 const PACKAGE: &'static str = "xds.core.v3";
171 fn full_name() -> ::prost::alloc::string::String {
172 "xds.core.v3.ResourceLocator.Directive".into()
173 }
174 fn type_url() -> ::prost::alloc::string::String {
175 "/xds.core.v3.ResourceLocator.Directive".into()
176 }
177 }
178 #[derive(
179 Clone,
180 Copy,
181 Debug,
182 PartialEq,
183 Eq,
184 Hash,
185 PartialOrd,
186 Ord,
187 ::prost::Enumeration
188 )]
189 #[repr(i32)]
190 pub enum Scheme {
191 Xdstp = 0,
192 Http = 1,
193 File = 2,
194 }
195 impl Scheme {
196 /// String value of the enum field names used in the ProtoBuf definition.
197 ///
198 /// The values are not transformed in any way and thus are considered stable
199 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
200 pub fn as_str_name(&self) -> &'static str {
201 match self {
202 Self::Xdstp => "XDSTP",
203 Self::Http => "HTTP",
204 Self::File => "FILE",
205 }
206 }
207 /// Creates an enum from field names used in the ProtoBuf definition.
208 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
209 match value {
210 "XDSTP" => Some(Self::Xdstp),
211 "HTTP" => Some(Self::Http),
212 "FILE" => Some(Self::File),
213 _ => None,
214 }
215 }
216 }
217 #[derive(Clone, PartialEq, ::prost::Oneof)]
218 pub enum ContextParamSpecifier {
219 /// Additional parameters that can be used to select resource variants.
220 /// Matches must be exact, i.e. all context parameters must match exactly and
221 /// there must be no additional context parameters set on the matched
222 /// resource.
223 #[prost(message, tag = "5")]
224 ExactContext(super::ContextParams),
225 }
226}
227impl ::prost::Name for ResourceLocator {
228 const NAME: &'static str = "ResourceLocator";
229 const PACKAGE: &'static str = "xds.core.v3";
230 fn full_name() -> ::prost::alloc::string::String {
231 "xds.core.v3.ResourceLocator".into()
232 }
233 fn type_url() -> ::prost::alloc::string::String {
234 "/xds.core.v3.ResourceLocator".into()
235 }
236}
237/// xDS collection resource wrapper. This encapsulates a xDS resource when
238/// appearing inside a list collection resource. List collection resources are
239/// regular Resource messages of type:
240///
241/// .. code-block:: proto
242///
243/// message <T>Collection {
244/// repeated CollectionEntry resources = 1;
245/// }
246///
247#[derive(Clone, PartialEq, ::prost::Message)]
248pub struct CollectionEntry {
249 #[prost(oneof = "collection_entry::ResourceSpecifier", tags = "1, 2")]
250 pub resource_specifier: ::core::option::Option<collection_entry::ResourceSpecifier>,
251}
252/// Nested message and enum types in `CollectionEntry`.
253pub mod collection_entry {
254 /// Inlined resource entry.
255 #[derive(Clone, PartialEq, ::prost::Message)]
256 pub struct InlineEntry {
257 /// Optional name to describe the inlined resource. Resource names must match
258 /// ``\[a-zA-Z0-9_-\./\]+`` (TODO(htuch): turn this into a PGV constraint once
259 /// finalized, probably should be a RFC3986 pchar). This name allows
260 /// reference via the #entry directive in ResourceLocator.
261 #[prost(string, tag = "1")]
262 pub name: ::prost::alloc::string::String,
263 /// The resource's logical version. It is illegal to have the same named xDS
264 /// resource name at a given version with different resource payloads.
265 #[prost(string, tag = "2")]
266 pub version: ::prost::alloc::string::String,
267 /// The resource payload, including type URL.
268 #[prost(message, optional, tag = "3")]
269 pub resource: ::core::option::Option<
270 super::super::super::super::google::protobuf::Any,
271 >,
272 }
273 impl ::prost::Name for InlineEntry {
274 const NAME: &'static str = "InlineEntry";
275 const PACKAGE: &'static str = "xds.core.v3";
276 fn full_name() -> ::prost::alloc::string::String {
277 "xds.core.v3.CollectionEntry.InlineEntry".into()
278 }
279 fn type_url() -> ::prost::alloc::string::String {
280 "/xds.core.v3.CollectionEntry.InlineEntry".into()
281 }
282 }
283 #[derive(Clone, PartialEq, ::prost::Oneof)]
284 pub enum ResourceSpecifier {
285 /// A resource locator describing how the member resource is to be located.
286 #[prost(message, tag = "1")]
287 Locator(super::ResourceLocator),
288 /// The resource is inlined in the list collection.
289 #[prost(message, tag = "2")]
290 InlineEntry(InlineEntry),
291 }
292}
293impl ::prost::Name for CollectionEntry {
294 const NAME: &'static str = "CollectionEntry";
295 const PACKAGE: &'static str = "xds.core.v3";
296 fn full_name() -> ::prost::alloc::string::String {
297 "xds.core.v3.CollectionEntry".into()
298 }
299 fn type_url() -> ::prost::alloc::string::String {
300 "/xds.core.v3.CollectionEntry".into()
301 }
302}