rls_config.pb.swift 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. // swiftlint:disable all
  4. //
  5. // Generated by the Swift generator plugin for the protocol buffer compiler.
  6. // Source: grpc/lookup/v1/rls_config.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Copyright 2020 The gRPC Authors
  11. //
  12. // Licensed under the Apache License, Version 2.0 (the "License");
  13. // you may not use this file except in compliance with the License.
  14. // You may obtain a copy of the License at
  15. //
  16. // http://www.apache.org/licenses/LICENSE-2.0
  17. //
  18. // Unless required by applicable law or agreed to in writing, software
  19. // distributed under the License is distributed on an "AS IS" BASIS,
  20. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  21. // See the License for the specific language governing permissions and
  22. // limitations under the License.
  23. import Foundation
  24. import SwiftProtobuf
  25. // If the compiler emits an error on this type, it is because this file
  26. // was generated by a version of the `protoc` Swift plug-in that is
  27. // incompatible with the version of SwiftProtobuf to which you are linking.
  28. // Please ensure that you are building against the same version of the API
  29. // that was used to generate this file.
  30. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  31. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  32. typealias Version = _2
  33. }
  34. /// Extract a key based on a given name (e.g. header name or query parameter
  35. /// name). The name must match one of the names listed in the "name" field. If
  36. /// the "required_match" field is true, one of the specified names must be
  37. /// present for the keybuilder to match.
  38. struct Grpc_Lookup_V1_NameMatcher: Sendable {
  39. // SwiftProtobuf.Message conformance is added in an extension below. See the
  40. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  41. // methods supported on all messages.
  42. /// The name that will be used in the RLS key_map to refer to this value.
  43. /// If required_match is true, you may omit this field or set it to an empty
  44. /// string, in which case the matcher will require a match, but won't update
  45. /// the key_map.
  46. var key: String = String()
  47. /// Ordered list of names (headers or query parameter names) that can supply
  48. /// this value; the first one with a non-empty value is used.
  49. var names: [String] = []
  50. /// If true, make this extraction required; the key builder will not match
  51. /// if no value is found.
  52. var requiredMatch: Bool = false
  53. var unknownFields = SwiftProtobuf.UnknownStorage()
  54. init() {}
  55. }
  56. /// A GrpcKeyBuilder applies to a given gRPC service, name, and headers.
  57. struct Grpc_Lookup_V1_GrpcKeyBuilder: Sendable {
  58. // SwiftProtobuf.Message conformance is added in an extension below. See the
  59. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  60. // methods supported on all messages.
  61. var names: [Grpc_Lookup_V1_GrpcKeyBuilder.Name] = []
  62. var extraKeys: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys {
  63. get {return _extraKeys ?? Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys()}
  64. set {_extraKeys = newValue}
  65. }
  66. /// Returns true if `extraKeys` has been explicitly set.
  67. var hasExtraKeys: Bool {return self._extraKeys != nil}
  68. /// Clears the value of `extraKeys`. Subsequent reads from it will return its default value.
  69. mutating func clearExtraKeys() {self._extraKeys = nil}
  70. /// Extract keys from all listed headers.
  71. /// For gRPC, it is an error to specify "required_match" on the NameMatcher
  72. /// protos.
  73. var headers: [Grpc_Lookup_V1_NameMatcher] = []
  74. /// You can optionally set one or more specific key/value pairs to be added to
  75. /// the key_map. This can be useful to identify which builder built the key,
  76. /// for example if you are suppressing the actual method, but need to
  77. /// separately cache and request all the matched methods.
  78. var constantKeys: Dictionary<String,String> = [:]
  79. var unknownFields = SwiftProtobuf.UnknownStorage()
  80. /// To match, one of the given Name fields must match; the service and method
  81. /// fields are specified as fixed strings. The service name is required and
  82. /// includes the proto package name. The method name may be omitted, in
  83. /// which case any method on the given service is matched.
  84. struct Name: Sendable {
  85. // SwiftProtobuf.Message conformance is added in an extension below. See the
  86. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  87. // methods supported on all messages.
  88. var service: String = String()
  89. var method: String = String()
  90. var unknownFields = SwiftProtobuf.UnknownStorage()
  91. init() {}
  92. }
  93. /// If you wish to include the host, service, or method names as keys in the
  94. /// generated RouteLookupRequest, specify key names to use in the extra_keys
  95. /// submessage. If a key name is empty, no key will be set for that value.
  96. /// If this submessage is specified, the normal host/path fields will be left
  97. /// unset in the RouteLookupRequest. We are deprecating host/path in the
  98. /// RouteLookupRequest, so services should migrate to the ExtraKeys approach.
  99. struct ExtraKeys: Sendable {
  100. // SwiftProtobuf.Message conformance is added in an extension below. See the
  101. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  102. // methods supported on all messages.
  103. var host: String = String()
  104. var service: String = String()
  105. var method: String = String()
  106. var unknownFields = SwiftProtobuf.UnknownStorage()
  107. init() {}
  108. }
  109. init() {}
  110. fileprivate var _extraKeys: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys? = nil
  111. }
  112. /// An HttpKeyBuilder applies to a given HTTP URL and headers.
  113. ///
  114. /// Path and host patterns use the matching syntax from gRPC transcoding to
  115. /// extract named key/value pairs from the path and host components of the URL:
  116. /// https://github.com/googleapis/googleapis/blob/master/google/api/http.proto
  117. ///
  118. /// It is invalid to specify the same key name in multiple places in a pattern.
  119. ///
  120. /// For a service where the project id can be expressed either as a subdomain or
  121. /// in the path, separate HttpKeyBuilders must be used:
  122. /// host_pattern: 'example.com' path_pattern: '/{id}/{object}/**'
  123. /// host_pattern: '{id}.example.com' path_pattern: '/{object}/**'
  124. /// If the host is exactly 'example.com', the first path segment will be used as
  125. /// the id and the second segment as the object. If the host has a subdomain, the
  126. /// subdomain will be used as the id and the first segment as the object. If
  127. /// neither pattern matches, no keys will be extracted.
  128. struct Grpc_Lookup_V1_HttpKeyBuilder: Sendable {
  129. // SwiftProtobuf.Message conformance is added in an extension below. See the
  130. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  131. // methods supported on all messages.
  132. /// host_pattern is an ordered list of host template patterns for the desired
  133. /// value. If any host_pattern values are specified, then at least one must
  134. /// match, and the last one wins and sets any specified variables. A host
  135. /// consists of labels separated by dots. Each label is matched against the
  136. /// label in the pattern as follows:
  137. /// - "*": Matches any single label.
  138. /// - "**": Matches zero or more labels (first or last part of host only).
  139. /// - "{<name>=...}": One or more label capture, where "..." can be any
  140. /// template that does not include a capture.
  141. /// - "{<name>}": A single label capture. Identical to {<name>=*}.
  142. ///
  143. /// Examples:
  144. /// - "example.com": Only applies to the exact host example.com.
  145. /// - "*.example.com": Matches subdomains of example.com.
  146. /// - "**.example.com": matches example.com, and all levels of subdomains.
  147. /// - "{project}.example.com": Extracts the third level subdomain.
  148. /// - "{project=**}.example.com": Extracts the third level+ subdomains.
  149. /// - "{project=**}": Extracts the entire host.
  150. var hostPatterns: [String] = []
  151. /// path_pattern is an ordered list of path template patterns for the desired
  152. /// value. If any path_pattern values are specified, then at least one must
  153. /// match, and the last one wins and sets any specified variables. A path
  154. /// consists of segments separated by slashes. Each segment is matched against
  155. /// the segment in the pattern as follows:
  156. /// - "*": Matches any single segment.
  157. /// - "**": Matches zero or more segments (first or last part of path only).
  158. /// - "{<name>=...}": One or more segment capture, where "..." can be any
  159. /// template that does not include a capture.
  160. /// - "{<name>}": A single segment capture. Identical to {<name>=*}.
  161. /// A custom method may also be specified by appending ":" and the custom
  162. /// method name or "*" to indicate any custom method (including no custom
  163. /// method). For example, "/*/projects/{project_id}/**:*" extracts
  164. /// `{project_id}` for any version, resource and custom method that includes
  165. /// it. By default, any custom method will be matched.
  166. ///
  167. /// Examples:
  168. /// - "/v1/{name=messages/*}": extracts a name like "messages/12345".
  169. /// - "/v1/messages/{message_id}": extracts a message_id like "12345".
  170. /// - "/v1/users/{user_id}/messages/{message_id}": extracts two key values.
  171. var pathPatterns: [String] = []
  172. /// List of query parameter names to try to match.
  173. /// For example: ["parent", "name", "resource.name"]
  174. /// We extract all the specified query_parameters (case-sensitively). If any
  175. /// are marked as "required_match" and are not present, this keybuilder fails
  176. /// to match. If a given parameter appears multiple times (?foo=a&foo=b) we
  177. /// will report it as a comma-separated string (foo=a,b).
  178. var queryParameters: [Grpc_Lookup_V1_NameMatcher] = []
  179. /// List of headers to try to match.
  180. /// We extract all the specified header values (case-insensitively). If any
  181. /// are marked as "required_match" and are not present, this keybuilder fails
  182. /// to match. If a given header appears multiple times in the request we will
  183. /// report it as a comma-separated string, in standard HTTP fashion.
  184. var headers: [Grpc_Lookup_V1_NameMatcher] = []
  185. /// You can optionally set one or more specific key/value pairs to be added to
  186. /// the key_map. This can be useful to identify which builder built the key,
  187. /// for example if you are suppressing a lot of information from the URL, but
  188. /// need to separately cache and request URLs with that content.
  189. var constantKeys: Dictionary<String,String> = [:]
  190. var unknownFields = SwiftProtobuf.UnknownStorage()
  191. init() {}
  192. }
  193. struct Grpc_Lookup_V1_RouteLookupConfig: Sendable {
  194. // SwiftProtobuf.Message conformance is added in an extension below. See the
  195. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  196. // methods supported on all messages.
  197. /// Ordered specifications for constructing keys for HTTP requests. Last
  198. /// match wins. If no HttpKeyBuilder matches, an empty key_map will be sent to
  199. /// the lookup service; it should likely reply with a global default route
  200. /// and raise an alert.
  201. var httpKeybuilders: [Grpc_Lookup_V1_HttpKeyBuilder] = []
  202. /// Unordered specifications for constructing keys for gRPC requests. All
  203. /// GrpcKeyBuilders on this list must have unique "name" fields so that the
  204. /// client is free to prebuild a hash map keyed by name. If no GrpcKeyBuilder
  205. /// matches, an empty key_map will be sent to the lookup service; it should
  206. /// likely reply with a global default route and raise an alert.
  207. var grpcKeybuilders: [Grpc_Lookup_V1_GrpcKeyBuilder] = []
  208. /// The name of the lookup service as a gRPC URI. Typically, this will be
  209. /// a subdomain of the target, such as "lookup.datastore.googleapis.com".
  210. var lookupService: String = String()
  211. /// Configure a timeout value for lookup service requests.
  212. /// Defaults to 10 seconds if not specified.
  213. var lookupServiceTimeout: SwiftProtobuf.Google_Protobuf_Duration {
  214. get {return _lookupServiceTimeout ?? SwiftProtobuf.Google_Protobuf_Duration()}
  215. set {_lookupServiceTimeout = newValue}
  216. }
  217. /// Returns true if `lookupServiceTimeout` has been explicitly set.
  218. var hasLookupServiceTimeout: Bool {return self._lookupServiceTimeout != nil}
  219. /// Clears the value of `lookupServiceTimeout`. Subsequent reads from it will return its default value.
  220. mutating func clearLookupServiceTimeout() {self._lookupServiceTimeout = nil}
  221. /// How long are responses valid for (like HTTP Cache-Control).
  222. /// If omitted or zero, the longest valid cache time is used.
  223. /// This value is clamped to 5 minutes to avoid unflushable bad responses.
  224. var maxAge: SwiftProtobuf.Google_Protobuf_Duration {
  225. get {return _maxAge ?? SwiftProtobuf.Google_Protobuf_Duration()}
  226. set {_maxAge = newValue}
  227. }
  228. /// Returns true if `maxAge` has been explicitly set.
  229. var hasMaxAge: Bool {return self._maxAge != nil}
  230. /// Clears the value of `maxAge`. Subsequent reads from it will return its default value.
  231. mutating func clearMaxAge() {self._maxAge = nil}
  232. /// After a response has been in the client cache for this amount of time
  233. /// and is re-requested, start an asynchronous RPC to re-validate it.
  234. /// This value should be less than max_age by at least the length of a
  235. /// typical RTT to the Route Lookup Service to fully mask the RTT latency.
  236. /// If omitted, keys are only re-requested after they have expired.
  237. var staleAge: SwiftProtobuf.Google_Protobuf_Duration {
  238. get {return _staleAge ?? SwiftProtobuf.Google_Protobuf_Duration()}
  239. set {_staleAge = newValue}
  240. }
  241. /// Returns true if `staleAge` has been explicitly set.
  242. var hasStaleAge: Bool {return self._staleAge != nil}
  243. /// Clears the value of `staleAge`. Subsequent reads from it will return its default value.
  244. mutating func clearStaleAge() {self._staleAge = nil}
  245. /// Rough indicator of amount of memory to use for the client cache. Some of
  246. /// the data structure overhead is not accounted for, so actual memory consumed
  247. /// will be somewhat greater than this value. If this field is omitted or set
  248. /// to zero, a client default will be used. The value may be capped to a lower
  249. /// amount based on client configuration.
  250. var cacheSizeBytes: Int64 = 0
  251. /// This is a list of all the possible targets that can be returned by the
  252. /// lookup service. If a target not on this list is returned, it will be
  253. /// treated the same as an unhealthy target.
  254. var validTargets: [String] = []
  255. /// This value provides a default target to use if needed. If set, it will be
  256. /// used if RLS returns an error, times out, or returns an invalid response.
  257. /// Note that requests can be routed only to a subdomain of the original
  258. /// target, e.g. "us_east_1.cloudbigtable.googleapis.com".
  259. var defaultTarget: String = String()
  260. var unknownFields = SwiftProtobuf.UnknownStorage()
  261. init() {}
  262. fileprivate var _lookupServiceTimeout: SwiftProtobuf.Google_Protobuf_Duration? = nil
  263. fileprivate var _maxAge: SwiftProtobuf.Google_Protobuf_Duration? = nil
  264. fileprivate var _staleAge: SwiftProtobuf.Google_Protobuf_Duration? = nil
  265. }
  266. /// RouteLookupClusterSpecifier is used in xDS to represent a cluster specifier
  267. /// plugin for RLS.
  268. struct Grpc_Lookup_V1_RouteLookupClusterSpecifier: Sendable {
  269. // SwiftProtobuf.Message conformance is added in an extension below. See the
  270. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  271. // methods supported on all messages.
  272. /// The RLS config for this cluster specifier plugin instance.
  273. var routeLookupConfig: Grpc_Lookup_V1_RouteLookupConfig {
  274. get {return _routeLookupConfig ?? Grpc_Lookup_V1_RouteLookupConfig()}
  275. set {_routeLookupConfig = newValue}
  276. }
  277. /// Returns true if `routeLookupConfig` has been explicitly set.
  278. var hasRouteLookupConfig: Bool {return self._routeLookupConfig != nil}
  279. /// Clears the value of `routeLookupConfig`. Subsequent reads from it will return its default value.
  280. mutating func clearRouteLookupConfig() {self._routeLookupConfig = nil}
  281. var unknownFields = SwiftProtobuf.UnknownStorage()
  282. init() {}
  283. fileprivate var _routeLookupConfig: Grpc_Lookup_V1_RouteLookupConfig? = nil
  284. }
  285. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  286. fileprivate let _protobuf_package = "grpc.lookup.v1"
  287. extension Grpc_Lookup_V1_NameMatcher: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  288. static let protoMessageName: String = _protobuf_package + ".NameMatcher"
  289. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  290. 1: .same(proto: "key"),
  291. 2: .same(proto: "names"),
  292. 3: .standard(proto: "required_match"),
  293. ]
  294. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  295. while let fieldNumber = try decoder.nextFieldNumber() {
  296. // The use of inline closures is to circumvent an issue where the compiler
  297. // allocates stack space for every case branch when no optimizations are
  298. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  299. switch fieldNumber {
  300. case 1: try { try decoder.decodeSingularStringField(value: &self.key) }()
  301. case 2: try { try decoder.decodeRepeatedStringField(value: &self.names) }()
  302. case 3: try { try decoder.decodeSingularBoolField(value: &self.requiredMatch) }()
  303. default: break
  304. }
  305. }
  306. }
  307. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  308. if !self.key.isEmpty {
  309. try visitor.visitSingularStringField(value: self.key, fieldNumber: 1)
  310. }
  311. if !self.names.isEmpty {
  312. try visitor.visitRepeatedStringField(value: self.names, fieldNumber: 2)
  313. }
  314. if self.requiredMatch != false {
  315. try visitor.visitSingularBoolField(value: self.requiredMatch, fieldNumber: 3)
  316. }
  317. try unknownFields.traverse(visitor: &visitor)
  318. }
  319. static func ==(lhs: Grpc_Lookup_V1_NameMatcher, rhs: Grpc_Lookup_V1_NameMatcher) -> Bool {
  320. if lhs.key != rhs.key {return false}
  321. if lhs.names != rhs.names {return false}
  322. if lhs.requiredMatch != rhs.requiredMatch {return false}
  323. if lhs.unknownFields != rhs.unknownFields {return false}
  324. return true
  325. }
  326. }
  327. extension Grpc_Lookup_V1_GrpcKeyBuilder: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  328. static let protoMessageName: String = _protobuf_package + ".GrpcKeyBuilder"
  329. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  330. 1: .same(proto: "names"),
  331. 3: .standard(proto: "extra_keys"),
  332. 2: .same(proto: "headers"),
  333. 4: .standard(proto: "constant_keys"),
  334. ]
  335. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  336. while let fieldNumber = try decoder.nextFieldNumber() {
  337. // The use of inline closures is to circumvent an issue where the compiler
  338. // allocates stack space for every case branch when no optimizations are
  339. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  340. switch fieldNumber {
  341. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.names) }()
  342. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.headers) }()
  343. case 3: try { try decoder.decodeSingularMessageField(value: &self._extraKeys) }()
  344. case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.constantKeys) }()
  345. default: break
  346. }
  347. }
  348. }
  349. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  350. // The use of inline closures is to circumvent an issue where the compiler
  351. // allocates stack space for every if/case branch local when no optimizations
  352. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  353. // https://github.com/apple/swift-protobuf/issues/1182
  354. if !self.names.isEmpty {
  355. try visitor.visitRepeatedMessageField(value: self.names, fieldNumber: 1)
  356. }
  357. if !self.headers.isEmpty {
  358. try visitor.visitRepeatedMessageField(value: self.headers, fieldNumber: 2)
  359. }
  360. try { if let v = self._extraKeys {
  361. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  362. } }()
  363. if !self.constantKeys.isEmpty {
  364. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.constantKeys, fieldNumber: 4)
  365. }
  366. try unknownFields.traverse(visitor: &visitor)
  367. }
  368. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder, rhs: Grpc_Lookup_V1_GrpcKeyBuilder) -> Bool {
  369. if lhs.names != rhs.names {return false}
  370. if lhs._extraKeys != rhs._extraKeys {return false}
  371. if lhs.headers != rhs.headers {return false}
  372. if lhs.constantKeys != rhs.constantKeys {return false}
  373. if lhs.unknownFields != rhs.unknownFields {return false}
  374. return true
  375. }
  376. }
  377. extension Grpc_Lookup_V1_GrpcKeyBuilder.Name: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  378. static let protoMessageName: String = Grpc_Lookup_V1_GrpcKeyBuilder.protoMessageName + ".Name"
  379. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  380. 1: .same(proto: "service"),
  381. 2: .same(proto: "method"),
  382. ]
  383. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  384. while let fieldNumber = try decoder.nextFieldNumber() {
  385. // The use of inline closures is to circumvent an issue where the compiler
  386. // allocates stack space for every case branch when no optimizations are
  387. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  388. switch fieldNumber {
  389. case 1: try { try decoder.decodeSingularStringField(value: &self.service) }()
  390. case 2: try { try decoder.decodeSingularStringField(value: &self.method) }()
  391. default: break
  392. }
  393. }
  394. }
  395. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  396. if !self.service.isEmpty {
  397. try visitor.visitSingularStringField(value: self.service, fieldNumber: 1)
  398. }
  399. if !self.method.isEmpty {
  400. try visitor.visitSingularStringField(value: self.method, fieldNumber: 2)
  401. }
  402. try unknownFields.traverse(visitor: &visitor)
  403. }
  404. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder.Name, rhs: Grpc_Lookup_V1_GrpcKeyBuilder.Name) -> Bool {
  405. if lhs.service != rhs.service {return false}
  406. if lhs.method != rhs.method {return false}
  407. if lhs.unknownFields != rhs.unknownFields {return false}
  408. return true
  409. }
  410. }
  411. extension Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  412. static let protoMessageName: String = Grpc_Lookup_V1_GrpcKeyBuilder.protoMessageName + ".ExtraKeys"
  413. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  414. 1: .same(proto: "host"),
  415. 2: .same(proto: "service"),
  416. 3: .same(proto: "method"),
  417. ]
  418. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  419. while let fieldNumber = try decoder.nextFieldNumber() {
  420. // The use of inline closures is to circumvent an issue where the compiler
  421. // allocates stack space for every case branch when no optimizations are
  422. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  423. switch fieldNumber {
  424. case 1: try { try decoder.decodeSingularStringField(value: &self.host) }()
  425. case 2: try { try decoder.decodeSingularStringField(value: &self.service) }()
  426. case 3: try { try decoder.decodeSingularStringField(value: &self.method) }()
  427. default: break
  428. }
  429. }
  430. }
  431. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  432. if !self.host.isEmpty {
  433. try visitor.visitSingularStringField(value: self.host, fieldNumber: 1)
  434. }
  435. if !self.service.isEmpty {
  436. try visitor.visitSingularStringField(value: self.service, fieldNumber: 2)
  437. }
  438. if !self.method.isEmpty {
  439. try visitor.visitSingularStringField(value: self.method, fieldNumber: 3)
  440. }
  441. try unknownFields.traverse(visitor: &visitor)
  442. }
  443. static func ==(lhs: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys, rhs: Grpc_Lookup_V1_GrpcKeyBuilder.ExtraKeys) -> Bool {
  444. if lhs.host != rhs.host {return false}
  445. if lhs.service != rhs.service {return false}
  446. if lhs.method != rhs.method {return false}
  447. if lhs.unknownFields != rhs.unknownFields {return false}
  448. return true
  449. }
  450. }
  451. extension Grpc_Lookup_V1_HttpKeyBuilder: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  452. static let protoMessageName: String = _protobuf_package + ".HttpKeyBuilder"
  453. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  454. 1: .standard(proto: "host_patterns"),
  455. 2: .standard(proto: "path_patterns"),
  456. 3: .standard(proto: "query_parameters"),
  457. 4: .same(proto: "headers"),
  458. 5: .standard(proto: "constant_keys"),
  459. ]
  460. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  461. while let fieldNumber = try decoder.nextFieldNumber() {
  462. // The use of inline closures is to circumvent an issue where the compiler
  463. // allocates stack space for every case branch when no optimizations are
  464. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  465. switch fieldNumber {
  466. case 1: try { try decoder.decodeRepeatedStringField(value: &self.hostPatterns) }()
  467. case 2: try { try decoder.decodeRepeatedStringField(value: &self.pathPatterns) }()
  468. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.queryParameters) }()
  469. case 4: try { try decoder.decodeRepeatedMessageField(value: &self.headers) }()
  470. case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.constantKeys) }()
  471. default: break
  472. }
  473. }
  474. }
  475. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  476. if !self.hostPatterns.isEmpty {
  477. try visitor.visitRepeatedStringField(value: self.hostPatterns, fieldNumber: 1)
  478. }
  479. if !self.pathPatterns.isEmpty {
  480. try visitor.visitRepeatedStringField(value: self.pathPatterns, fieldNumber: 2)
  481. }
  482. if !self.queryParameters.isEmpty {
  483. try visitor.visitRepeatedMessageField(value: self.queryParameters, fieldNumber: 3)
  484. }
  485. if !self.headers.isEmpty {
  486. try visitor.visitRepeatedMessageField(value: self.headers, fieldNumber: 4)
  487. }
  488. if !self.constantKeys.isEmpty {
  489. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.constantKeys, fieldNumber: 5)
  490. }
  491. try unknownFields.traverse(visitor: &visitor)
  492. }
  493. static func ==(lhs: Grpc_Lookup_V1_HttpKeyBuilder, rhs: Grpc_Lookup_V1_HttpKeyBuilder) -> Bool {
  494. if lhs.hostPatterns != rhs.hostPatterns {return false}
  495. if lhs.pathPatterns != rhs.pathPatterns {return false}
  496. if lhs.queryParameters != rhs.queryParameters {return false}
  497. if lhs.headers != rhs.headers {return false}
  498. if lhs.constantKeys != rhs.constantKeys {return false}
  499. if lhs.unknownFields != rhs.unknownFields {return false}
  500. return true
  501. }
  502. }
  503. extension Grpc_Lookup_V1_RouteLookupConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  504. static let protoMessageName: String = _protobuf_package + ".RouteLookupConfig"
  505. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  506. 1: .standard(proto: "http_keybuilders"),
  507. 2: .standard(proto: "grpc_keybuilders"),
  508. 3: .standard(proto: "lookup_service"),
  509. 4: .standard(proto: "lookup_service_timeout"),
  510. 5: .standard(proto: "max_age"),
  511. 6: .standard(proto: "stale_age"),
  512. 7: .standard(proto: "cache_size_bytes"),
  513. 8: .standard(proto: "valid_targets"),
  514. 9: .standard(proto: "default_target"),
  515. ]
  516. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  517. while let fieldNumber = try decoder.nextFieldNumber() {
  518. // The use of inline closures is to circumvent an issue where the compiler
  519. // allocates stack space for every case branch when no optimizations are
  520. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  521. switch fieldNumber {
  522. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.httpKeybuilders) }()
  523. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.grpcKeybuilders) }()
  524. case 3: try { try decoder.decodeSingularStringField(value: &self.lookupService) }()
  525. case 4: try { try decoder.decodeSingularMessageField(value: &self._lookupServiceTimeout) }()
  526. case 5: try { try decoder.decodeSingularMessageField(value: &self._maxAge) }()
  527. case 6: try { try decoder.decodeSingularMessageField(value: &self._staleAge) }()
  528. case 7: try { try decoder.decodeSingularInt64Field(value: &self.cacheSizeBytes) }()
  529. case 8: try { try decoder.decodeRepeatedStringField(value: &self.validTargets) }()
  530. case 9: try { try decoder.decodeSingularStringField(value: &self.defaultTarget) }()
  531. default: break
  532. }
  533. }
  534. }
  535. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  536. // The use of inline closures is to circumvent an issue where the compiler
  537. // allocates stack space for every if/case branch local when no optimizations
  538. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  539. // https://github.com/apple/swift-protobuf/issues/1182
  540. if !self.httpKeybuilders.isEmpty {
  541. try visitor.visitRepeatedMessageField(value: self.httpKeybuilders, fieldNumber: 1)
  542. }
  543. if !self.grpcKeybuilders.isEmpty {
  544. try visitor.visitRepeatedMessageField(value: self.grpcKeybuilders, fieldNumber: 2)
  545. }
  546. if !self.lookupService.isEmpty {
  547. try visitor.visitSingularStringField(value: self.lookupService, fieldNumber: 3)
  548. }
  549. try { if let v = self._lookupServiceTimeout {
  550. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  551. } }()
  552. try { if let v = self._maxAge {
  553. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  554. } }()
  555. try { if let v = self._staleAge {
  556. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  557. } }()
  558. if self.cacheSizeBytes != 0 {
  559. try visitor.visitSingularInt64Field(value: self.cacheSizeBytes, fieldNumber: 7)
  560. }
  561. if !self.validTargets.isEmpty {
  562. try visitor.visitRepeatedStringField(value: self.validTargets, fieldNumber: 8)
  563. }
  564. if !self.defaultTarget.isEmpty {
  565. try visitor.visitSingularStringField(value: self.defaultTarget, fieldNumber: 9)
  566. }
  567. try unknownFields.traverse(visitor: &visitor)
  568. }
  569. static func ==(lhs: Grpc_Lookup_V1_RouteLookupConfig, rhs: Grpc_Lookup_V1_RouteLookupConfig) -> Bool {
  570. if lhs.httpKeybuilders != rhs.httpKeybuilders {return false}
  571. if lhs.grpcKeybuilders != rhs.grpcKeybuilders {return false}
  572. if lhs.lookupService != rhs.lookupService {return false}
  573. if lhs._lookupServiceTimeout != rhs._lookupServiceTimeout {return false}
  574. if lhs._maxAge != rhs._maxAge {return false}
  575. if lhs._staleAge != rhs._staleAge {return false}
  576. if lhs.cacheSizeBytes != rhs.cacheSizeBytes {return false}
  577. if lhs.validTargets != rhs.validTargets {return false}
  578. if lhs.defaultTarget != rhs.defaultTarget {return false}
  579. if lhs.unknownFields != rhs.unknownFields {return false}
  580. return true
  581. }
  582. }
  583. extension Grpc_Lookup_V1_RouteLookupClusterSpecifier: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  584. static let protoMessageName: String = _protobuf_package + ".RouteLookupClusterSpecifier"
  585. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  586. 1: .standard(proto: "route_lookup_config"),
  587. ]
  588. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  589. while let fieldNumber = try decoder.nextFieldNumber() {
  590. // The use of inline closures is to circumvent an issue where the compiler
  591. // allocates stack space for every case branch when no optimizations are
  592. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  593. switch fieldNumber {
  594. case 1: try { try decoder.decodeSingularMessageField(value: &self._routeLookupConfig) }()
  595. default: break
  596. }
  597. }
  598. }
  599. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  600. // The use of inline closures is to circumvent an issue where the compiler
  601. // allocates stack space for every if/case branch local when no optimizations
  602. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  603. // https://github.com/apple/swift-protobuf/issues/1182
  604. try { if let v = self._routeLookupConfig {
  605. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  606. } }()
  607. try unknownFields.traverse(visitor: &visitor)
  608. }
  609. static func ==(lhs: Grpc_Lookup_V1_RouteLookupClusterSpecifier, rhs: Grpc_Lookup_V1_RouteLookupClusterSpecifier) -> Bool {
  610. if lhs._routeLookupConfig != rhs._routeLookupConfig {return false}
  611. if lhs.unknownFields != rhs.unknownFields {return false}
  612. return true
  613. }
  614. }