github.com/jhump/protocompile@v0.0.0-20221021153901-4f6f732835e8/internal/tags.go (about)

     1  package internal
     2  
     3  import "math"
     4  
     5  const (
     6  	// MaxNormalTag is the maximum allowed tag number for a field in a normal message.
     7  	MaxNormalTag = 536870911 // 2^29 - 1
     8  
     9  	// MaxMessageSetTag is the maximum allowed tag number of a field in a message that
    10  	// uses the message set wire format.
    11  	MaxMessageSetTag = math.MaxInt32 - 1
    12  
    13  	// MaxTag is the maximum allowed tag number. (It is the same as MaxMessageSetTag
    14  	// since that is the absolute highest allowed.)
    15  	MaxTag = MaxMessageSetTag
    16  
    17  	// SpecialReservedStart is the first tag in a range that is reserved and not
    18  	// allowed for use in message definitions.
    19  	SpecialReservedStart = 19000
    20  	// SpecialReservedEnd is the last tag in a range that is reserved and not
    21  	// allowed for use in message definitions.
    22  	SpecialReservedEnd = 19999
    23  
    24  	// NB: It would be nice to use constants from generated code instead of
    25  	// hard-coding these here. But code-gen does not emit these as constants
    26  	// anywhere. The only places they appear in generated code are struct tags
    27  	// on fields of the generated descriptor protos.
    28  
    29  	// File_packageTag is the tag number of the package element in a file
    30  	// descriptor proto.
    31  	File_packageTag = 2
    32  	// File_dependencyTag is the tag number of the dependencies element in a
    33  	// file descriptor proto.
    34  	File_dependencyTag = 3
    35  	// File_messagesTag is the tag number of the messages element in a file
    36  	// descriptor proto.
    37  	File_messagesTag = 4
    38  	// File_enumsTag is the tag number of the enums element in a file descriptor
    39  	// proto.
    40  	File_enumsTag = 5
    41  	// File_servicesTag is the tag number of the services element in a file
    42  	// descriptor proto.
    43  	File_servicesTag = 6
    44  	// File_extensionsTag is the tag number of the extensions element in a file
    45  	// descriptor proto.
    46  	File_extensionsTag = 7
    47  	// File_optionsTag is the tag number of the options element in a file
    48  	// descriptor proto.
    49  	File_optionsTag = 8
    50  	// File_syntaxTag is the tag number of the syntax element in a file
    51  	// descriptor proto.
    52  	File_syntaxTag = 12
    53  	// Message_nameTag is the tag number of the name element in a message
    54  	// descriptor proto.
    55  	Message_nameTag = 1
    56  	// Message_fieldsTag is the tag number of the fields element in a message
    57  	// descriptor proto.
    58  	Message_fieldsTag = 2
    59  	// Message_nestedMessagesTag is the tag number of the nested messages
    60  	// element in a message descriptor proto.
    61  	Message_nestedMessagesTag = 3
    62  	// Message_enumsTag is the tag number of the enums element in a message
    63  	// descriptor proto.
    64  	Message_enumsTag = 4
    65  	// Message_extensionRangeTag is the tag number of the extension ranges
    66  	// element in a message descriptor proto.
    67  	Message_extensionRangeTag = 5
    68  	// Message_extensionsTag is the tag number of the extensions element in a
    69  	// message descriptor proto.
    70  	Message_extensionsTag = 6
    71  	// Message_optionsTag is the tag number of the options element in a message
    72  	// descriptor proto.
    73  	Message_optionsTag = 7
    74  	// Message_oneOfsTag is the tag number of the one-ofs element in a message
    75  	// descriptor proto.
    76  	Message_oneOfsTag = 8
    77  	// Message_reservedRangeTag is the tag number of the reserved ranges element
    78  	// in a message descriptor proto.
    79  	Message_reservedRangeTag = 9
    80  	// Message_reservedNameTag is the tag number of the reserved names element
    81  	// in a message descriptor proto.
    82  	Message_reservedNameTag = 10
    83  	// ExtensionRange_startTag is the tag number of the start index in an
    84  	// extension range proto.
    85  	ExtensionRange_startTag = 1
    86  	// ExtensionRange_endTag is the tag number of the end index in an
    87  	// extension range proto.
    88  	ExtensionRange_endTag = 2
    89  	// ExtensionRange_optionsTag is the tag number of the options element in an
    90  	// extension range proto.
    91  	ExtensionRange_optionsTag = 3
    92  	// ReservedRange_startTag is the tag number of the start index in a reserved
    93  	// range proto.
    94  	ReservedRange_startTag = 1
    95  	// ReservedRange_endTag is the tag number of the end index in a reserved
    96  	// range proto.
    97  	ReservedRange_endTag = 2
    98  	// Field_nameTag is the tag number of the name element in a field descriptor
    99  	// proto.
   100  	Field_nameTag = 1
   101  	// Field_extendeeTag is the tag number of the extendee element in a field
   102  	// descriptor proto.
   103  	Field_extendeeTag = 2
   104  	// Field_numberTag is the tag number of the number element in a field
   105  	// descriptor proto.
   106  	Field_numberTag = 3
   107  	// Field_labelTag is the tag number of the label element in a field
   108  	// descriptor proto.
   109  	Field_labelTag = 4
   110  	// Field_typeTag is the tag number of the type element in a field descriptor
   111  	// proto.
   112  	Field_typeTag = 5
   113  	// Field_typeNameTag is the tag number of the type name element in a field
   114  	// descriptor proto.
   115  	Field_typeNameTag = 6
   116  	// Field_defaultTag is the tag number of the default value element in a
   117  	// field descriptor proto.
   118  	Field_defaultTag = 7
   119  	// Field_optionsTag is the tag number of the options element in a field
   120  	// descriptor proto.
   121  	Field_optionsTag = 8
   122  	// Field_jsonNameTag is the tag number of the JSON name element in a field
   123  	// descriptor proto.
   124  	Field_jsonNameTag = 10
   125  	// Field_proto3OptionalTag is the tag number of the proto3_optional element
   126  	// in a descriptor proto.
   127  	Field_proto3OptionalTag = 17
   128  	// OneOf_nameTag is the tag number of the name element in a one-of
   129  	// descriptor proto.
   130  	OneOf_nameTag = 1
   131  	// OneOf_optionsTag is the tag number of the options element in a one-of
   132  	// descriptor proto.
   133  	OneOf_optionsTag = 2
   134  	// Enum_nameTag is the tag number of the name element in an enum descriptor
   135  	// proto.
   136  	Enum_nameTag = 1
   137  	// Enum_valuesTag is the tag number of the values element in an enum
   138  	// descriptor proto.
   139  	Enum_valuesTag = 2
   140  	// Enum_optionsTag is the tag number of the options element in an enum
   141  	// descriptor proto.
   142  	Enum_optionsTag = 3
   143  	// Enum_reservedRangeTag is the tag number of the reserved ranges element in
   144  	// an enum descriptor proto.
   145  	Enum_reservedRangeTag = 4
   146  	// Enum_reservedNameTag is the tag number of the reserved names element in
   147  	// an enum descriptor proto.
   148  	Enum_reservedNameTag = 5
   149  	// EnumVal_nameTag is the tag number of the name element in an enum value
   150  	// descriptor proto.
   151  	EnumVal_nameTag = 1
   152  	// EnumVal_numberTag is the tag number of the number element in an enum
   153  	// value descriptor proto.
   154  	EnumVal_numberTag = 2
   155  	// EnumVal_optionsTag is the tag number of the options element in an enum
   156  	// value descriptor proto.
   157  	EnumVal_optionsTag = 3
   158  	// Service_nameTag is the tag number of the name element in a service
   159  	// descriptor proto.
   160  	Service_nameTag = 1
   161  	// Service_methodsTag is the tag number of the methods element in a service
   162  	// descriptor proto.
   163  	Service_methodsTag = 2
   164  	// Service_optionsTag is the tag number of the options element in a service
   165  	// descriptor proto.
   166  	Service_optionsTag = 3
   167  	// Method_nameTag is the tag number of the name element in a method
   168  	// descriptor proto.
   169  	Method_nameTag = 1
   170  	// Method_inputTag is the tag number of the input type element in a method
   171  	// descriptor proto.
   172  	Method_inputTag = 2
   173  	// Method_outputTag is the tag number of the output type element in a method
   174  	// descriptor proto.
   175  	Method_outputTag = 3
   176  	// Method_optionsTag is the tag number of the options element in a method
   177  	// descriptor proto.
   178  	Method_optionsTag = 4
   179  	// Method_inputStreamTag is the tag number of the input stream flag in a
   180  	// method descriptor proto.
   181  	Method_inputStreamTag = 5
   182  	// Method_outputStreamTag is the tag number of the output stream flag in a
   183  	// method descriptor proto.
   184  	Method_outputStreamTag = 6
   185  
   186  	// UninterpretedOptionsTag is the tag number of the uninterpreted options
   187  	// element. All *Options messages use the same tag for the field that stores
   188  	// uninterpreted options.
   189  	UninterpretedOptionsTag = 999
   190  
   191  	// Uninterpreted_nameTag is the tag number of the name element in an
   192  	// uninterpreted options proto.
   193  	Uninterpreted_nameTag = 2
   194  	// Uninterpreted_identTag is the tag number of the identifier value in an
   195  	// uninterpreted options proto.
   196  	Uninterpreted_identTag = 3
   197  	// Uninterpreted_posIntTag is the tag number of the positive int value in an
   198  	// uninterpreted options proto.
   199  	Uninterpreted_posIntTag = 4
   200  	// Uninterpreted_negIntTag is the tag number of the negative int value in an
   201  	// uninterpreted options proto.
   202  	Uninterpreted_negIntTag = 5
   203  	// Uninterpreted_doubleTag is the tag number of the double value in an
   204  	// uninterpreted options proto.
   205  	Uninterpreted_doubleTag = 6
   206  	// Uninterpreted_stringTag is the tag number of the string value in an
   207  	// uninterpreted options proto.
   208  	Uninterpreted_stringTag = 7
   209  	// Uninterpreted_aggregateTag is the tag number of the aggregate value in an
   210  	// uninterpreted options proto.
   211  	Uninterpreted_aggregateTag = 8
   212  	// UninterpretedName_nameTag is the tag number of the name element in an
   213  	// uninterpreted option name proto.
   214  	UninterpretedName_nameTag = 1
   215  )