source_gen.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. // Copyright 2019 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated by generate-protos. DO NOT EDIT.
  5. package protoreflect
  6. func (p *SourcePath) appendFileDescriptorProto(b []byte) []byte {
  7. if len(*p) == 0 {
  8. return b
  9. }
  10. switch (*p)[0] {
  11. case 1:
  12. b = p.appendSingularField(b, "name", nil)
  13. case 2:
  14. b = p.appendSingularField(b, "package", nil)
  15. case 3:
  16. b = p.appendRepeatedField(b, "dependency", nil)
  17. case 10:
  18. b = p.appendRepeatedField(b, "public_dependency", nil)
  19. case 11:
  20. b = p.appendRepeatedField(b, "weak_dependency", nil)
  21. case 4:
  22. b = p.appendRepeatedField(b, "message_type", (*SourcePath).appendDescriptorProto)
  23. case 5:
  24. b = p.appendRepeatedField(b, "enum_type", (*SourcePath).appendEnumDescriptorProto)
  25. case 6:
  26. b = p.appendRepeatedField(b, "service", (*SourcePath).appendServiceDescriptorProto)
  27. case 7:
  28. b = p.appendRepeatedField(b, "extension", (*SourcePath).appendFieldDescriptorProto)
  29. case 8:
  30. b = p.appendSingularField(b, "options", (*SourcePath).appendFileOptions)
  31. case 9:
  32. b = p.appendSingularField(b, "source_code_info", (*SourcePath).appendSourceCodeInfo)
  33. case 12:
  34. b = p.appendSingularField(b, "syntax", nil)
  35. case 14:
  36. b = p.appendSingularField(b, "edition", nil)
  37. }
  38. return b
  39. }
  40. func (p *SourcePath) appendDescriptorProto(b []byte) []byte {
  41. if len(*p) == 0 {
  42. return b
  43. }
  44. switch (*p)[0] {
  45. case 1:
  46. b = p.appendSingularField(b, "name", nil)
  47. case 2:
  48. b = p.appendRepeatedField(b, "field", (*SourcePath).appendFieldDescriptorProto)
  49. case 6:
  50. b = p.appendRepeatedField(b, "extension", (*SourcePath).appendFieldDescriptorProto)
  51. case 3:
  52. b = p.appendRepeatedField(b, "nested_type", (*SourcePath).appendDescriptorProto)
  53. case 4:
  54. b = p.appendRepeatedField(b, "enum_type", (*SourcePath).appendEnumDescriptorProto)
  55. case 5:
  56. b = p.appendRepeatedField(b, "extension_range", (*SourcePath).appendDescriptorProto_ExtensionRange)
  57. case 8:
  58. b = p.appendRepeatedField(b, "oneof_decl", (*SourcePath).appendOneofDescriptorProto)
  59. case 7:
  60. b = p.appendSingularField(b, "options", (*SourcePath).appendMessageOptions)
  61. case 9:
  62. b = p.appendRepeatedField(b, "reserved_range", (*SourcePath).appendDescriptorProto_ReservedRange)
  63. case 10:
  64. b = p.appendRepeatedField(b, "reserved_name", nil)
  65. }
  66. return b
  67. }
  68. func (p *SourcePath) appendEnumDescriptorProto(b []byte) []byte {
  69. if len(*p) == 0 {
  70. return b
  71. }
  72. switch (*p)[0] {
  73. case 1:
  74. b = p.appendSingularField(b, "name", nil)
  75. case 2:
  76. b = p.appendRepeatedField(b, "value", (*SourcePath).appendEnumValueDescriptorProto)
  77. case 3:
  78. b = p.appendSingularField(b, "options", (*SourcePath).appendEnumOptions)
  79. case 4:
  80. b = p.appendRepeatedField(b, "reserved_range", (*SourcePath).appendEnumDescriptorProto_EnumReservedRange)
  81. case 5:
  82. b = p.appendRepeatedField(b, "reserved_name", nil)
  83. }
  84. return b
  85. }
  86. func (p *SourcePath) appendServiceDescriptorProto(b []byte) []byte {
  87. if len(*p) == 0 {
  88. return b
  89. }
  90. switch (*p)[0] {
  91. case 1:
  92. b = p.appendSingularField(b, "name", nil)
  93. case 2:
  94. b = p.appendRepeatedField(b, "method", (*SourcePath).appendMethodDescriptorProto)
  95. case 3:
  96. b = p.appendSingularField(b, "options", (*SourcePath).appendServiceOptions)
  97. }
  98. return b
  99. }
  100. func (p *SourcePath) appendFieldDescriptorProto(b []byte) []byte {
  101. if len(*p) == 0 {
  102. return b
  103. }
  104. switch (*p)[0] {
  105. case 1:
  106. b = p.appendSingularField(b, "name", nil)
  107. case 3:
  108. b = p.appendSingularField(b, "number", nil)
  109. case 4:
  110. b = p.appendSingularField(b, "label", nil)
  111. case 5:
  112. b = p.appendSingularField(b, "type", nil)
  113. case 6:
  114. b = p.appendSingularField(b, "type_name", nil)
  115. case 2:
  116. b = p.appendSingularField(b, "extendee", nil)
  117. case 7:
  118. b = p.appendSingularField(b, "default_value", nil)
  119. case 9:
  120. b = p.appendSingularField(b, "oneof_index", nil)
  121. case 10:
  122. b = p.appendSingularField(b, "json_name", nil)
  123. case 8:
  124. b = p.appendSingularField(b, "options", (*SourcePath).appendFieldOptions)
  125. case 17:
  126. b = p.appendSingularField(b, "proto3_optional", nil)
  127. }
  128. return b
  129. }
  130. func (p *SourcePath) appendFileOptions(b []byte) []byte {
  131. if len(*p) == 0 {
  132. return b
  133. }
  134. switch (*p)[0] {
  135. case 1:
  136. b = p.appendSingularField(b, "java_package", nil)
  137. case 8:
  138. b = p.appendSingularField(b, "java_outer_classname", nil)
  139. case 10:
  140. b = p.appendSingularField(b, "java_multiple_files", nil)
  141. case 20:
  142. b = p.appendSingularField(b, "java_generate_equals_and_hash", nil)
  143. case 27:
  144. b = p.appendSingularField(b, "java_string_check_utf8", nil)
  145. case 9:
  146. b = p.appendSingularField(b, "optimize_for", nil)
  147. case 11:
  148. b = p.appendSingularField(b, "go_package", nil)
  149. case 16:
  150. b = p.appendSingularField(b, "cc_generic_services", nil)
  151. case 17:
  152. b = p.appendSingularField(b, "java_generic_services", nil)
  153. case 18:
  154. b = p.appendSingularField(b, "py_generic_services", nil)
  155. case 23:
  156. b = p.appendSingularField(b, "deprecated", nil)
  157. case 31:
  158. b = p.appendSingularField(b, "cc_enable_arenas", nil)
  159. case 36:
  160. b = p.appendSingularField(b, "objc_class_prefix", nil)
  161. case 37:
  162. b = p.appendSingularField(b, "csharp_namespace", nil)
  163. case 39:
  164. b = p.appendSingularField(b, "swift_prefix", nil)
  165. case 40:
  166. b = p.appendSingularField(b, "php_class_prefix", nil)
  167. case 41:
  168. b = p.appendSingularField(b, "php_namespace", nil)
  169. case 44:
  170. b = p.appendSingularField(b, "php_metadata_namespace", nil)
  171. case 45:
  172. b = p.appendSingularField(b, "ruby_package", nil)
  173. case 50:
  174. b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
  175. case 999:
  176. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  177. }
  178. return b
  179. }
  180. func (p *SourcePath) appendSourceCodeInfo(b []byte) []byte {
  181. if len(*p) == 0 {
  182. return b
  183. }
  184. switch (*p)[0] {
  185. case 1:
  186. b = p.appendRepeatedField(b, "location", (*SourcePath).appendSourceCodeInfo_Location)
  187. }
  188. return b
  189. }
  190. func (p *SourcePath) appendDescriptorProto_ExtensionRange(b []byte) []byte {
  191. if len(*p) == 0 {
  192. return b
  193. }
  194. switch (*p)[0] {
  195. case 1:
  196. b = p.appendSingularField(b, "start", nil)
  197. case 2:
  198. b = p.appendSingularField(b, "end", nil)
  199. case 3:
  200. b = p.appendSingularField(b, "options", (*SourcePath).appendExtensionRangeOptions)
  201. }
  202. return b
  203. }
  204. func (p *SourcePath) appendOneofDescriptorProto(b []byte) []byte {
  205. if len(*p) == 0 {
  206. return b
  207. }
  208. switch (*p)[0] {
  209. case 1:
  210. b = p.appendSingularField(b, "name", nil)
  211. case 2:
  212. b = p.appendSingularField(b, "options", (*SourcePath).appendOneofOptions)
  213. }
  214. return b
  215. }
  216. func (p *SourcePath) appendMessageOptions(b []byte) []byte {
  217. if len(*p) == 0 {
  218. return b
  219. }
  220. switch (*p)[0] {
  221. case 1:
  222. b = p.appendSingularField(b, "message_set_wire_format", nil)
  223. case 2:
  224. b = p.appendSingularField(b, "no_standard_descriptor_accessor", nil)
  225. case 3:
  226. b = p.appendSingularField(b, "deprecated", nil)
  227. case 7:
  228. b = p.appendSingularField(b, "map_entry", nil)
  229. case 11:
  230. b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil)
  231. case 12:
  232. b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
  233. case 999:
  234. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  235. }
  236. return b
  237. }
  238. func (p *SourcePath) appendDescriptorProto_ReservedRange(b []byte) []byte {
  239. if len(*p) == 0 {
  240. return b
  241. }
  242. switch (*p)[0] {
  243. case 1:
  244. b = p.appendSingularField(b, "start", nil)
  245. case 2:
  246. b = p.appendSingularField(b, "end", nil)
  247. }
  248. return b
  249. }
  250. func (p *SourcePath) appendEnumValueDescriptorProto(b []byte) []byte {
  251. if len(*p) == 0 {
  252. return b
  253. }
  254. switch (*p)[0] {
  255. case 1:
  256. b = p.appendSingularField(b, "name", nil)
  257. case 2:
  258. b = p.appendSingularField(b, "number", nil)
  259. case 3:
  260. b = p.appendSingularField(b, "options", (*SourcePath).appendEnumValueOptions)
  261. }
  262. return b
  263. }
  264. func (p *SourcePath) appendEnumOptions(b []byte) []byte {
  265. if len(*p) == 0 {
  266. return b
  267. }
  268. switch (*p)[0] {
  269. case 2:
  270. b = p.appendSingularField(b, "allow_alias", nil)
  271. case 3:
  272. b = p.appendSingularField(b, "deprecated", nil)
  273. case 6:
  274. b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil)
  275. case 7:
  276. b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
  277. case 999:
  278. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  279. }
  280. return b
  281. }
  282. func (p *SourcePath) appendEnumDescriptorProto_EnumReservedRange(b []byte) []byte {
  283. if len(*p) == 0 {
  284. return b
  285. }
  286. switch (*p)[0] {
  287. case 1:
  288. b = p.appendSingularField(b, "start", nil)
  289. case 2:
  290. b = p.appendSingularField(b, "end", nil)
  291. }
  292. return b
  293. }
  294. func (p *SourcePath) appendMethodDescriptorProto(b []byte) []byte {
  295. if len(*p) == 0 {
  296. return b
  297. }
  298. switch (*p)[0] {
  299. case 1:
  300. b = p.appendSingularField(b, "name", nil)
  301. case 2:
  302. b = p.appendSingularField(b, "input_type", nil)
  303. case 3:
  304. b = p.appendSingularField(b, "output_type", nil)
  305. case 4:
  306. b = p.appendSingularField(b, "options", (*SourcePath).appendMethodOptions)
  307. case 5:
  308. b = p.appendSingularField(b, "client_streaming", nil)
  309. case 6:
  310. b = p.appendSingularField(b, "server_streaming", nil)
  311. }
  312. return b
  313. }
  314. func (p *SourcePath) appendServiceOptions(b []byte) []byte {
  315. if len(*p) == 0 {
  316. return b
  317. }
  318. switch (*p)[0] {
  319. case 34:
  320. b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
  321. case 33:
  322. b = p.appendSingularField(b, "deprecated", nil)
  323. case 999:
  324. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  325. }
  326. return b
  327. }
  328. func (p *SourcePath) appendFieldOptions(b []byte) []byte {
  329. if len(*p) == 0 {
  330. return b
  331. }
  332. switch (*p)[0] {
  333. case 1:
  334. b = p.appendSingularField(b, "ctype", nil)
  335. case 2:
  336. b = p.appendSingularField(b, "packed", nil)
  337. case 6:
  338. b = p.appendSingularField(b, "jstype", nil)
  339. case 5:
  340. b = p.appendSingularField(b, "lazy", nil)
  341. case 15:
  342. b = p.appendSingularField(b, "unverified_lazy", nil)
  343. case 3:
  344. b = p.appendSingularField(b, "deprecated", nil)
  345. case 10:
  346. b = p.appendSingularField(b, "weak", nil)
  347. case 16:
  348. b = p.appendSingularField(b, "debug_redact", nil)
  349. case 17:
  350. b = p.appendSingularField(b, "retention", nil)
  351. case 19:
  352. b = p.appendRepeatedField(b, "targets", nil)
  353. case 20:
  354. b = p.appendRepeatedField(b, "edition_defaults", (*SourcePath).appendFieldOptions_EditionDefault)
  355. case 21:
  356. b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
  357. case 999:
  358. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  359. }
  360. return b
  361. }
  362. func (p *SourcePath) appendFeatureSet(b []byte) []byte {
  363. if len(*p) == 0 {
  364. return b
  365. }
  366. switch (*p)[0] {
  367. case 1:
  368. b = p.appendSingularField(b, "field_presence", nil)
  369. case 2:
  370. b = p.appendSingularField(b, "enum_type", nil)
  371. case 3:
  372. b = p.appendSingularField(b, "repeated_field_encoding", nil)
  373. case 4:
  374. b = p.appendSingularField(b, "utf8_validation", nil)
  375. case 5:
  376. b = p.appendSingularField(b, "message_encoding", nil)
  377. case 6:
  378. b = p.appendSingularField(b, "json_format", nil)
  379. }
  380. return b
  381. }
  382. func (p *SourcePath) appendUninterpretedOption(b []byte) []byte {
  383. if len(*p) == 0 {
  384. return b
  385. }
  386. switch (*p)[0] {
  387. case 2:
  388. b = p.appendRepeatedField(b, "name", (*SourcePath).appendUninterpretedOption_NamePart)
  389. case 3:
  390. b = p.appendSingularField(b, "identifier_value", nil)
  391. case 4:
  392. b = p.appendSingularField(b, "positive_int_value", nil)
  393. case 5:
  394. b = p.appendSingularField(b, "negative_int_value", nil)
  395. case 6:
  396. b = p.appendSingularField(b, "double_value", nil)
  397. case 7:
  398. b = p.appendSingularField(b, "string_value", nil)
  399. case 8:
  400. b = p.appendSingularField(b, "aggregate_value", nil)
  401. }
  402. return b
  403. }
  404. func (p *SourcePath) appendSourceCodeInfo_Location(b []byte) []byte {
  405. if len(*p) == 0 {
  406. return b
  407. }
  408. switch (*p)[0] {
  409. case 1:
  410. b = p.appendRepeatedField(b, "path", nil)
  411. case 2:
  412. b = p.appendRepeatedField(b, "span", nil)
  413. case 3:
  414. b = p.appendSingularField(b, "leading_comments", nil)
  415. case 4:
  416. b = p.appendSingularField(b, "trailing_comments", nil)
  417. case 6:
  418. b = p.appendRepeatedField(b, "leading_detached_comments", nil)
  419. }
  420. return b
  421. }
  422. func (p *SourcePath) appendExtensionRangeOptions(b []byte) []byte {
  423. if len(*p) == 0 {
  424. return b
  425. }
  426. switch (*p)[0] {
  427. case 999:
  428. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  429. case 2:
  430. b = p.appendRepeatedField(b, "declaration", (*SourcePath).appendExtensionRangeOptions_Declaration)
  431. case 50:
  432. b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
  433. case 3:
  434. b = p.appendSingularField(b, "verification", nil)
  435. }
  436. return b
  437. }
  438. func (p *SourcePath) appendOneofOptions(b []byte) []byte {
  439. if len(*p) == 0 {
  440. return b
  441. }
  442. switch (*p)[0] {
  443. case 1:
  444. b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
  445. case 999:
  446. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  447. }
  448. return b
  449. }
  450. func (p *SourcePath) appendEnumValueOptions(b []byte) []byte {
  451. if len(*p) == 0 {
  452. return b
  453. }
  454. switch (*p)[0] {
  455. case 1:
  456. b = p.appendSingularField(b, "deprecated", nil)
  457. case 2:
  458. b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
  459. case 3:
  460. b = p.appendSingularField(b, "debug_redact", nil)
  461. case 999:
  462. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  463. }
  464. return b
  465. }
  466. func (p *SourcePath) appendMethodOptions(b []byte) []byte {
  467. if len(*p) == 0 {
  468. return b
  469. }
  470. switch (*p)[0] {
  471. case 33:
  472. b = p.appendSingularField(b, "deprecated", nil)
  473. case 34:
  474. b = p.appendSingularField(b, "idempotency_level", nil)
  475. case 35:
  476. b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
  477. case 999:
  478. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  479. }
  480. return b
  481. }
  482. func (p *SourcePath) appendFieldOptions_EditionDefault(b []byte) []byte {
  483. if len(*p) == 0 {
  484. return b
  485. }
  486. switch (*p)[0] {
  487. case 3:
  488. b = p.appendSingularField(b, "edition", nil)
  489. case 2:
  490. b = p.appendSingularField(b, "value", nil)
  491. }
  492. return b
  493. }
  494. func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte {
  495. if len(*p) == 0 {
  496. return b
  497. }
  498. switch (*p)[0] {
  499. case 1:
  500. b = p.appendSingularField(b, "name_part", nil)
  501. case 2:
  502. b = p.appendSingularField(b, "is_extension", nil)
  503. }
  504. return b
  505. }
  506. func (p *SourcePath) appendExtensionRangeOptions_Declaration(b []byte) []byte {
  507. if len(*p) == 0 {
  508. return b
  509. }
  510. switch (*p)[0] {
  511. case 1:
  512. b = p.appendSingularField(b, "number", nil)
  513. case 2:
  514. b = p.appendSingularField(b, "full_name", nil)
  515. case 3:
  516. b = p.appendSingularField(b, "type", nil)
  517. case 5:
  518. b = p.appendSingularField(b, "reserved", nil)
  519. case 6:
  520. b = p.appendSingularField(b, "repeated", nil)
  521. }
  522. return b
  523. }