source_gen.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  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. }
  36. return b
  37. }
  38. func (p *SourcePath) appendDescriptorProto(b []byte) []byte {
  39. if len(*p) == 0 {
  40. return b
  41. }
  42. switch (*p)[0] {
  43. case 1:
  44. b = p.appendSingularField(b, "name", nil)
  45. case 2:
  46. b = p.appendRepeatedField(b, "field", (*SourcePath).appendFieldDescriptorProto)
  47. case 6:
  48. b = p.appendRepeatedField(b, "extension", (*SourcePath).appendFieldDescriptorProto)
  49. case 3:
  50. b = p.appendRepeatedField(b, "nested_type", (*SourcePath).appendDescriptorProto)
  51. case 4:
  52. b = p.appendRepeatedField(b, "enum_type", (*SourcePath).appendEnumDescriptorProto)
  53. case 5:
  54. b = p.appendRepeatedField(b, "extension_range", (*SourcePath).appendDescriptorProto_ExtensionRange)
  55. case 8:
  56. b = p.appendRepeatedField(b, "oneof_decl", (*SourcePath).appendOneofDescriptorProto)
  57. case 7:
  58. b = p.appendSingularField(b, "options", (*SourcePath).appendMessageOptions)
  59. case 9:
  60. b = p.appendRepeatedField(b, "reserved_range", (*SourcePath).appendDescriptorProto_ReservedRange)
  61. case 10:
  62. b = p.appendRepeatedField(b, "reserved_name", nil)
  63. }
  64. return b
  65. }
  66. func (p *SourcePath) appendEnumDescriptorProto(b []byte) []byte {
  67. if len(*p) == 0 {
  68. return b
  69. }
  70. switch (*p)[0] {
  71. case 1:
  72. b = p.appendSingularField(b, "name", nil)
  73. case 2:
  74. b = p.appendRepeatedField(b, "value", (*SourcePath).appendEnumValueDescriptorProto)
  75. case 3:
  76. b = p.appendSingularField(b, "options", (*SourcePath).appendEnumOptions)
  77. case 4:
  78. b = p.appendRepeatedField(b, "reserved_range", (*SourcePath).appendEnumDescriptorProto_EnumReservedRange)
  79. case 5:
  80. b = p.appendRepeatedField(b, "reserved_name", nil)
  81. }
  82. return b
  83. }
  84. func (p *SourcePath) appendServiceDescriptorProto(b []byte) []byte {
  85. if len(*p) == 0 {
  86. return b
  87. }
  88. switch (*p)[0] {
  89. case 1:
  90. b = p.appendSingularField(b, "name", nil)
  91. case 2:
  92. b = p.appendRepeatedField(b, "method", (*SourcePath).appendMethodDescriptorProto)
  93. case 3:
  94. b = p.appendSingularField(b, "options", (*SourcePath).appendServiceOptions)
  95. }
  96. return b
  97. }
  98. func (p *SourcePath) appendFieldDescriptorProto(b []byte) []byte {
  99. if len(*p) == 0 {
  100. return b
  101. }
  102. switch (*p)[0] {
  103. case 1:
  104. b = p.appendSingularField(b, "name", nil)
  105. case 3:
  106. b = p.appendSingularField(b, "number", nil)
  107. case 4:
  108. b = p.appendSingularField(b, "label", nil)
  109. case 5:
  110. b = p.appendSingularField(b, "type", nil)
  111. case 6:
  112. b = p.appendSingularField(b, "type_name", nil)
  113. case 2:
  114. b = p.appendSingularField(b, "extendee", nil)
  115. case 7:
  116. b = p.appendSingularField(b, "default_value", nil)
  117. case 9:
  118. b = p.appendSingularField(b, "oneof_index", nil)
  119. case 10:
  120. b = p.appendSingularField(b, "json_name", nil)
  121. case 8:
  122. b = p.appendSingularField(b, "options", (*SourcePath).appendFieldOptions)
  123. case 17:
  124. b = p.appendSingularField(b, "proto3_optional", nil)
  125. }
  126. return b
  127. }
  128. func (p *SourcePath) appendFileOptions(b []byte) []byte {
  129. if len(*p) == 0 {
  130. return b
  131. }
  132. switch (*p)[0] {
  133. case 1:
  134. b = p.appendSingularField(b, "java_package", nil)
  135. case 8:
  136. b = p.appendSingularField(b, "java_outer_classname", nil)
  137. case 10:
  138. b = p.appendSingularField(b, "java_multiple_files", nil)
  139. case 20:
  140. b = p.appendSingularField(b, "java_generate_equals_and_hash", nil)
  141. case 27:
  142. b = p.appendSingularField(b, "java_string_check_utf8", nil)
  143. case 9:
  144. b = p.appendSingularField(b, "optimize_for", nil)
  145. case 11:
  146. b = p.appendSingularField(b, "go_package", nil)
  147. case 16:
  148. b = p.appendSingularField(b, "cc_generic_services", nil)
  149. case 17:
  150. b = p.appendSingularField(b, "java_generic_services", nil)
  151. case 18:
  152. b = p.appendSingularField(b, "py_generic_services", nil)
  153. case 42:
  154. b = p.appendSingularField(b, "php_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 999:
  174. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  175. }
  176. return b
  177. }
  178. func (p *SourcePath) appendSourceCodeInfo(b []byte) []byte {
  179. if len(*p) == 0 {
  180. return b
  181. }
  182. switch (*p)[0] {
  183. case 1:
  184. b = p.appendRepeatedField(b, "location", (*SourcePath).appendSourceCodeInfo_Location)
  185. }
  186. return b
  187. }
  188. func (p *SourcePath) appendDescriptorProto_ExtensionRange(b []byte) []byte {
  189. if len(*p) == 0 {
  190. return b
  191. }
  192. switch (*p)[0] {
  193. case 1:
  194. b = p.appendSingularField(b, "start", nil)
  195. case 2:
  196. b = p.appendSingularField(b, "end", nil)
  197. case 3:
  198. b = p.appendSingularField(b, "options", (*SourcePath).appendExtensionRangeOptions)
  199. }
  200. return b
  201. }
  202. func (p *SourcePath) appendOneofDescriptorProto(b []byte) []byte {
  203. if len(*p) == 0 {
  204. return b
  205. }
  206. switch (*p)[0] {
  207. case 1:
  208. b = p.appendSingularField(b, "name", nil)
  209. case 2:
  210. b = p.appendSingularField(b, "options", (*SourcePath).appendOneofOptions)
  211. }
  212. return b
  213. }
  214. func (p *SourcePath) appendMessageOptions(b []byte) []byte {
  215. if len(*p) == 0 {
  216. return b
  217. }
  218. switch (*p)[0] {
  219. case 1:
  220. b = p.appendSingularField(b, "message_set_wire_format", nil)
  221. case 2:
  222. b = p.appendSingularField(b, "no_standard_descriptor_accessor", nil)
  223. case 3:
  224. b = p.appendSingularField(b, "deprecated", nil)
  225. case 7:
  226. b = p.appendSingularField(b, "map_entry", nil)
  227. case 999:
  228. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  229. }
  230. return b
  231. }
  232. func (p *SourcePath) appendDescriptorProto_ReservedRange(b []byte) []byte {
  233. if len(*p) == 0 {
  234. return b
  235. }
  236. switch (*p)[0] {
  237. case 1:
  238. b = p.appendSingularField(b, "start", nil)
  239. case 2:
  240. b = p.appendSingularField(b, "end", nil)
  241. }
  242. return b
  243. }
  244. func (p *SourcePath) appendEnumValueDescriptorProto(b []byte) []byte {
  245. if len(*p) == 0 {
  246. return b
  247. }
  248. switch (*p)[0] {
  249. case 1:
  250. b = p.appendSingularField(b, "name", nil)
  251. case 2:
  252. b = p.appendSingularField(b, "number", nil)
  253. case 3:
  254. b = p.appendSingularField(b, "options", (*SourcePath).appendEnumValueOptions)
  255. }
  256. return b
  257. }
  258. func (p *SourcePath) appendEnumOptions(b []byte) []byte {
  259. if len(*p) == 0 {
  260. return b
  261. }
  262. switch (*p)[0] {
  263. case 2:
  264. b = p.appendSingularField(b, "allow_alias", nil)
  265. case 3:
  266. b = p.appendSingularField(b, "deprecated", nil)
  267. case 999:
  268. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  269. }
  270. return b
  271. }
  272. func (p *SourcePath) appendEnumDescriptorProto_EnumReservedRange(b []byte) []byte {
  273. if len(*p) == 0 {
  274. return b
  275. }
  276. switch (*p)[0] {
  277. case 1:
  278. b = p.appendSingularField(b, "start", nil)
  279. case 2:
  280. b = p.appendSingularField(b, "end", nil)
  281. }
  282. return b
  283. }
  284. func (p *SourcePath) appendMethodDescriptorProto(b []byte) []byte {
  285. if len(*p) == 0 {
  286. return b
  287. }
  288. switch (*p)[0] {
  289. case 1:
  290. b = p.appendSingularField(b, "name", nil)
  291. case 2:
  292. b = p.appendSingularField(b, "input_type", nil)
  293. case 3:
  294. b = p.appendSingularField(b, "output_type", nil)
  295. case 4:
  296. b = p.appendSingularField(b, "options", (*SourcePath).appendMethodOptions)
  297. case 5:
  298. b = p.appendSingularField(b, "client_streaming", nil)
  299. case 6:
  300. b = p.appendSingularField(b, "server_streaming", nil)
  301. }
  302. return b
  303. }
  304. func (p *SourcePath) appendServiceOptions(b []byte) []byte {
  305. if len(*p) == 0 {
  306. return b
  307. }
  308. switch (*p)[0] {
  309. case 33:
  310. b = p.appendSingularField(b, "deprecated", nil)
  311. case 999:
  312. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  313. }
  314. return b
  315. }
  316. func (p *SourcePath) appendFieldOptions(b []byte) []byte {
  317. if len(*p) == 0 {
  318. return b
  319. }
  320. switch (*p)[0] {
  321. case 1:
  322. b = p.appendSingularField(b, "ctype", nil)
  323. case 2:
  324. b = p.appendSingularField(b, "packed", nil)
  325. case 6:
  326. b = p.appendSingularField(b, "jstype", nil)
  327. case 5:
  328. b = p.appendSingularField(b, "lazy", nil)
  329. case 3:
  330. b = p.appendSingularField(b, "deprecated", nil)
  331. case 10:
  332. b = p.appendSingularField(b, "weak", nil)
  333. case 999:
  334. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  335. }
  336. return b
  337. }
  338. func (p *SourcePath) appendUninterpretedOption(b []byte) []byte {
  339. if len(*p) == 0 {
  340. return b
  341. }
  342. switch (*p)[0] {
  343. case 2:
  344. b = p.appendRepeatedField(b, "name", (*SourcePath).appendUninterpretedOption_NamePart)
  345. case 3:
  346. b = p.appendSingularField(b, "identifier_value", nil)
  347. case 4:
  348. b = p.appendSingularField(b, "positive_int_value", nil)
  349. case 5:
  350. b = p.appendSingularField(b, "negative_int_value", nil)
  351. case 6:
  352. b = p.appendSingularField(b, "double_value", nil)
  353. case 7:
  354. b = p.appendSingularField(b, "string_value", nil)
  355. case 8:
  356. b = p.appendSingularField(b, "aggregate_value", nil)
  357. }
  358. return b
  359. }
  360. func (p *SourcePath) appendSourceCodeInfo_Location(b []byte) []byte {
  361. if len(*p) == 0 {
  362. return b
  363. }
  364. switch (*p)[0] {
  365. case 1:
  366. b = p.appendRepeatedField(b, "path", nil)
  367. case 2:
  368. b = p.appendRepeatedField(b, "span", nil)
  369. case 3:
  370. b = p.appendSingularField(b, "leading_comments", nil)
  371. case 4:
  372. b = p.appendSingularField(b, "trailing_comments", nil)
  373. case 6:
  374. b = p.appendRepeatedField(b, "leading_detached_comments", nil)
  375. }
  376. return b
  377. }
  378. func (p *SourcePath) appendExtensionRangeOptions(b []byte) []byte {
  379. if len(*p) == 0 {
  380. return b
  381. }
  382. switch (*p)[0] {
  383. case 999:
  384. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  385. }
  386. return b
  387. }
  388. func (p *SourcePath) appendOneofOptions(b []byte) []byte {
  389. if len(*p) == 0 {
  390. return b
  391. }
  392. switch (*p)[0] {
  393. case 999:
  394. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  395. }
  396. return b
  397. }
  398. func (p *SourcePath) appendEnumValueOptions(b []byte) []byte {
  399. if len(*p) == 0 {
  400. return b
  401. }
  402. switch (*p)[0] {
  403. case 1:
  404. b = p.appendSingularField(b, "deprecated", nil)
  405. case 999:
  406. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  407. }
  408. return b
  409. }
  410. func (p *SourcePath) appendMethodOptions(b []byte) []byte {
  411. if len(*p) == 0 {
  412. return b
  413. }
  414. switch (*p)[0] {
  415. case 33:
  416. b = p.appendSingularField(b, "deprecated", nil)
  417. case 34:
  418. b = p.appendSingularField(b, "idempotency_level", nil)
  419. case 999:
  420. b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
  421. }
  422. return b
  423. }
  424. func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte {
  425. if len(*p) == 0 {
  426. return b
  427. }
  428. switch (*p)[0] {
  429. case 1:
  430. b = p.appendSingularField(b, "name_part", nil)
  431. case 2:
  432. b = p.appendSingularField(b, "is_extension", nil)
  433. }
  434. return b
  435. }