...

Source file src/google.golang.org/protobuf/reflect/protoreflect/source_gen.go

Documentation: google.golang.org/protobuf/reflect/protoreflect

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

View as plain text