Go implementation for protocol buffers providing message serialization, reflection, and code generation
The descriptorpb package contains generated types for google/protobuf/descriptor.proto, which describes the structure of .proto files. These types represent file descriptors, message descriptors, field descriptors, enum descriptors, service descriptors, and their associated options.
import (
"google.golang.org/protobuf/types/descriptorpb"
"google.golang.org/protobuf/reflect/protoreflect"
)The top-level descriptor representing a complete .proto file.
// FileDescriptorProto describes a complete .proto file
type FileDescriptorProto struct {
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"`
// Names of files imported by this file
Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"`
// Indexes of the public imported files in the dependency list
PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"`
// Indexes of the weak imported files in the dependency list
WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"`
// All top-level definitions in this file
MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"`
EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"`
Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"`
Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"`
Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"`
// This field contains optional information about the original source code
SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"`
// The syntax of the proto file (proto2, proto3, or editions)
Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"`
Edition *Edition `protobuf:"varint,14,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"`
// Has unexported fields.
}
func (*FileDescriptorProto) ProtoMessage()
func (x *FileDescriptorProto) ProtoReflect() protoreflect.Message
func (x *FileDescriptorProto) Reset()
func (x *FileDescriptorProto) String() string
func (x *FileDescriptorProto) Get...() // Getter methods for each fieldDescribes a protocol buffer message type.
// DescriptorProto describes a message type
type DescriptorProto struct {
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"`
Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"`
NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type,json=nestedType" json:"nested_type,omitempty"`
EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"`
ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range,json=extensionRange" json:"extension_range,omitempty"`
OneofDecl []*OneofDescriptorProto `protobuf:"bytes,8,rep,name=oneof_decl,json=oneofDecl" json:"oneof_decl,omitempty"`
Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"`
ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"`
// Reserved field names, which may not be used by fields in the same message
ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"`
// Has unexported fields.
}
func (*DescriptorProto) ProtoMessage()
func (x *DescriptorProto) ProtoReflect() protoreflect.Message
func (x *DescriptorProto) Reset()
func (x *DescriptorProto) String() string
// ExtensionRange describes a range of extension field numbers
type DescriptorProto_ExtensionRange struct {
Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
Options *ExtensionRangeOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
// Has unexported fields.
}
// ReservedRange describes a range of reserved field numbers
type DescriptorProto_ReservedRange struct {
Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
// Has unexported fields.
}Describes a message field or extension field.
// FieldDescriptorProto describes a field in a message
type FieldDescriptorProto struct {
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"`
Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=google.protobuf.FieldDescriptorProto.Label" json:"label,omitempty"`
// If type_name is set, this need not be set
// If both this and type_name are set, this must be one of TYPE_ENUM,
// TYPE_MESSAGE or TYPE_GROUP
Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=google.protobuf.FieldDescriptorProto.Type" json:"type,omitempty"`
// For message and enum types, this is the name of the type
// If the name starts with a '.', it is fully-qualified
// Otherwise, C++-like scoping rules are used to find the type
TypeName *string `protobuf:"bytes,6,opt,name=type_name,json=typeName" json:"type_name,omitempty"`
// For extensions, this is the name of the type being extended
// It is resolved in the same manner as type_name
Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"`
// For numeric types, contains the original text representation of the value
// For booleans, "true" or "false"
// For strings, contains the default text contents (not escaped in any way)
// For bytes, contains the C escaped value
DefaultValue *string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"`
// If set, gives the index of a oneof in the containing type's oneof_decl list
// This field is a member of that oneof
OneofIndex *int32 `protobuf:"varint,9,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"`
// JSON name of this field
JsonName *string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"`
Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"`
// If true, this is a proto3 "optional" field
Proto3Optional *bool `protobuf:"varint,17,opt,name=proto3_optional,json=proto3Optional" json:"proto3_optional,omitempty"`
// Has unexported fields.
}
func (*FieldDescriptorProto) ProtoMessage()
func (x *FieldDescriptorProto) ProtoReflect() protoreflect.Message
func (x *FieldDescriptorProto) Reset()
func (x *FieldDescriptorProto) String() string
// Field types
type FieldDescriptorProto_Type int32
const (
FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1
FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2
FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3
FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4
FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5
FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6
FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7
FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8
FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9
FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10
FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11
FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12
FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13
FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14
FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15
FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16
FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17
FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18
)
// Field labels
type FieldDescriptorProto_Label int32
const (
FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1
FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3
FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2
)Describes a oneof field group.
// OneofDescriptorProto describes a oneof
type OneofDescriptorProto struct {
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Options *OneofOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"`
// Has unexported fields.
}
func (*OneofDescriptorProto) ProtoMessage()
func (x *OneofDescriptorProto) ProtoReflect() protoreflect.Message
func (x *OneofDescriptorProto) Reset()
func (x *OneofDescriptorProto) String() stringDescribes an enum type and its values.
// EnumDescriptorProto describes an enum type
type EnumDescriptorProto struct {
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"`
Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
// Range of reserved numeric values
ReservedRange []*EnumDescriptorProto_EnumReservedRange `protobuf:"bytes,4,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"`
// Reserved enum value names, which may not be reused
ReservedName []string `protobuf:"bytes,5,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"`
// Has unexported fields.
}
func (*EnumDescriptorProto) ProtoMessage()
func (x *EnumDescriptorProto) ProtoReflect() protoreflect.Message
func (x *EnumDescriptorProto) Reset()
func (x *EnumDescriptorProto) String() string
// EnumReservedRange describes a range of reserved enum values
type EnumDescriptorProto_EnumReservedRange struct {
Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
// Has unexported fields.
}
// EnumValueDescriptorProto describes an enum value
type EnumValueDescriptorProto struct {
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"`
Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
// Has unexported fields.
}
func (*EnumValueDescriptorProto) ProtoMessage()
func (x *EnumValueDescriptorProto) ProtoReflect() protoreflect.Message
func (x *EnumValueDescriptorProto) Reset()
func (x *EnumValueDescriptorProto) String() stringDescribes a gRPC service and its methods.
// ServiceDescriptorProto describes a service
type ServiceDescriptorProto struct {
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"`
Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
// Has unexported fields.
}
func (*ServiceDescriptorProto) ProtoMessage()
func (x *ServiceDescriptorProto) ProtoReflect() protoreflect.Message
func (x *ServiceDescriptorProto) Reset()
func (x *ServiceDescriptorProto) String() string
// MethodDescriptorProto describes a method of a service
type MethodDescriptorProto struct {
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
// Input and output type names
// These are resolved in the same way as FieldDescriptorProto.type_name
InputType *string `protobuf:"bytes,2,opt,name=input_type,json=inputType" json:"input_type,omitempty"`
OutputType *string `protobuf:"bytes,3,opt,name=output_type,json=outputType" json:"output_type,omitempty"`
Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"`
// Identifies if client streams multiple client messages
ClientStreaming *bool `protobuf:"varint,5,opt,name=client_streaming,json=clientStreaming,def=0" json:"client_streaming,omitempty"`
// Identifies if server streams multiple server messages
ServerStreaming *bool `protobuf:"varint,6,opt,name=server_streaming,json=serverStreaming,def=0" json:"server_streaming,omitempty"`
// Has unexported fields.
}
func (*MethodDescriptorProto) ProtoMessage()
func (x *MethodDescriptorProto) ProtoReflect() protoreflect.Message
func (x *MethodDescriptorProto) Reset()
func (x *MethodDescriptorProto) String() stringOptions for customizing the behavior of generated code and runtime behavior.
// FileOptions describes options for .proto files
type FileOptions struct {
JavaPackage *string `protobuf:"bytes,1,opt,name=java_package,json=javaPackage" json:"java_package,omitempty"`
JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname,json=javaOuterClassname" json:"java_outer_classname,omitempty"`
JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,json=javaMultipleFiles,def=0" json:"java_multiple_files,omitempty"`
JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash" json:"java_generate_equals_and_hash,omitempty"` // Deprecated
JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"`
OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions.OptimizeMode,def=1" json:"optimize_for,omitempty"`
GoPackage *string `protobuf:"bytes,11,opt,name=go_package,json=goPackage" json:"go_package,omitempty"`
CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,json=ccGenericServices,def=0" json:"cc_generic_services,omitempty"`
JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,json=javaGenericServices,def=0" json:"java_generic_services,omitempty"`
PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,json=pyGenericServices,def=0" json:"py_generic_services,omitempty"`
Deprecated *bool `protobuf:"varint,23,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
CcEnableArenas *bool `protobuf:"varint,31,opt,name=cc_enable_arenas,json=ccEnableArenas,def=1" json:"cc_enable_arenas,omitempty"`
ObjcClassPrefix *string `protobuf:"bytes,36,opt,name=objc_class_prefix,json=objcClassPrefix" json:"objc_class_prefix,omitempty"`
CsharpNamespace *string `protobuf:"bytes,37,opt,name=csharp_namespace,json=csharpNamespace" json:"csharp_namespace,omitempty"`
SwiftPrefix *string `protobuf:"bytes,39,opt,name=swift_prefix,json=swiftPrefix" json:"swift_prefix,omitempty"`
PhpClassPrefix *string `protobuf:"bytes,40,opt,name=php_class_prefix,json=phpClassPrefix" json:"php_class_prefix,omitempty"`
PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"`
PhpMetadataNamespace *string `protobuf:"bytes,44,opt,name=php_metadata_namespace,json=phpMetadataNamespace" json:"php_metadata_namespace,omitempty"`
RubyPackage *string `protobuf:"bytes,45,opt,name=ruby_package,json=rubyPackage" json:"ruby_package,omitempty"`
Features *FeatureSet `protobuf:"bytes,50,opt,name=features" json:"features,omitempty"`
// The parser stores options it doesn't recognize here
UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
// Has unexported fields.
}
// MessageOptions describes options for message types
type MessageOptions struct {
MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,json=messageSetWireFormat,def=0" json:"message_set_wire_format,omitempty"`
NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,json=noStandardDescriptorAccessor,def=0" json:"no_standard_descriptor_accessor,omitempty"`
Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
MapEntry *bool `protobuf:"varint,7,opt,name=map_entry,json=mapEntry" json:"map_entry,omitempty"`
DeprecatedLegacyJsonFieldConflicts *bool `protobuf:"varint,11,opt,name=deprecated_legacy_json_field_conflicts,json=deprecatedLegacyJsonFieldConflicts" json:"deprecated_legacy_json_field_conflicts,omitempty"` // Deprecated
Features *FeatureSet `protobuf:"bytes,12,opt,name=features" json:"features,omitempty"`
UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
// Has unexported fields.
}
// FieldOptions describes options for message fields
type FieldOptions struct {
Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=google.protobuf.FieldOptions.CType,def=0" json:"ctype,omitempty"`
Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"`
Jstype *FieldOptions_JSType `protobuf:"varint,6,opt,name=jstype,enum=google.protobuf.FieldOptions.JSType,def=0" json:"jstype,omitempty"`
Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"`
Unverified *bool `protobuf:"varint,15,opt,name=unverified,def=0" json:"unverified,omitempty"`
Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"`
DebugRedact *bool `protobuf:"varint,16,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"`
Retention *FieldOptions_OptionRetention `protobuf:"varint,17,opt,name=retention,enum=google.protobuf.FieldOptions.OptionRetention" json:"retention,omitempty"`
Targets []FieldOptions_OptionTargetType `protobuf:"varint,19,rep,name=targets,enum=google.protobuf.FieldOptions.OptionTargetType" json:"targets,omitempty"`
EditionDefaults []*FieldOptions_EditionDefault `protobuf:"bytes,20,rep,name=edition_defaults,json=editionDefaults" json:"edition_defaults,omitempty"`
Features *FeatureSet `protobuf:"bytes,21,opt,name=features" json:"features,omitempty"`
FeatureSupport *FieldOptions_FeatureSupport `protobuf:"bytes,22,opt,name=feature_support,json=featureSupport" json:"feature_support,omitempty"`
UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
// Has unexported fields.
}
// OneofOptions describes options for oneof fields
type OneofOptions struct {
Features *FeatureSet `protobuf:"bytes,1,opt,name=features" json:"features,omitempty"`
UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
// Has unexported fields.
}
// EnumOptions describes options for enum types
type EnumOptions struct {
AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias" json:"allow_alias,omitempty"`
Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
DeprecatedLegacyJsonFieldConflicts *bool `protobuf:"varint,6,opt,name=deprecated_legacy_json_field_conflicts,json=deprecatedLegacyJsonFieldConflicts" json:"deprecated_legacy_json_field_conflicts,omitempty"` // Deprecated
Features *FeatureSet `protobuf:"bytes,7,opt,name=features" json:"features,omitempty"`
UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
// Has unexported fields.
}
// EnumValueOptions describes options for enum values
type EnumValueOptions struct {
Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
Features *FeatureSet `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"`
DebugRedact *bool `protobuf:"varint,3,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"`
FeatureSupport *FieldOptions_FeatureSupport `protobuf:"bytes,4,opt,name=feature_support,json=featureSupport" json:"feature_support,omitempty"`
UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
// Has unexported fields.
}
// ServiceOptions describes options for services
type ServiceOptions struct {
Features *FeatureSet `protobuf:"bytes,34,opt,name=features" json:"features,omitempty"`
Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
// Has unexported fields.
}
// MethodOptions describes options for RPC methods
type MethodOptions struct {
Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
IdempotencyLevel *MethodOptions_IdempotencyLevel `protobuf:"varint,34,opt,name=idempotency_level,json=idempotencyLevel,enum=google.protobuf.MethodOptions.IdempotencyLevel,def=0" json:"idempotency_level,omitempty"`
Features *FeatureSet `protobuf:"bytes,35,opt,name=features" json:"features,omitempty"`
UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
// Has unexported fields.
}
// ExtensionRangeOptions describes options for extension ranges
type ExtensionRangeOptions struct {
UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
Declaration []*ExtensionRangeOptions_Declaration `protobuf:"bytes,2,rep,name=declaration" json:"declaration,omitempty"`
Features *FeatureSet `protobuf:"bytes,50,opt,name=features" json:"features,omitempty"`
Verification *ExtensionRangeOptions_VerificationState `protobuf:"varint,3,opt,name=verification,enum=google.protobuf.ExtensionRangeOptions.VerificationState,def=1" json:"verification,omitempty"`
// Has unexported fields.
}Information about the original source code, used for code generation and IDE integration.
// SourceCodeInfo encapsulates information about the original source file from which
// a FileDescriptorProto was generated
type SourceCodeInfo struct {
// A Location identifies a piece of source code in a .proto file which
// corresponds to a particular definition
Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"`
// Has unexported fields.
}
// Location describes a source location
type SourceCodeInfo_Location struct {
// Identifies which part of the FileDescriptorProto was defined at this location
Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"`
// Always has exactly three or four elements: start line, start column,
// end line (optional, otherwise assumed same as start line), end column
Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"`
// If this SourceCodeInfo_Location represents a complete declaration,
// these are any comments appearing before and after the declaration
LeadingComments *string `protobuf:"bytes,3,opt,name=leading_comments,json=leadingComments" json:"leading_comments,omitempty"`
TrailingComments *string `protobuf:"bytes,4,opt,name=trailing_comments,json=trailingComments" json:"trailing_comments,omitempty"`
LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments" json:"leading_detached_comments,omitempty"`
// Has unexported fields.
}
// GeneratedCodeInfo describes annotations about generated code
type GeneratedCodeInfo struct {
// An Annotation connects some span of text in generated code to an element
// of its generating .proto file
Annotation []*GeneratedCodeInfo_Annotation `protobuf:"bytes,1,rep,name=annotation" json:"annotation,omitempty"`
// Has unexported fields.
}
type GeneratedCodeInfo_Annotation struct {
// Identifies the element in the original source .proto file
Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"`
SourceFile *string `protobuf:"bytes,2,opt,name=source_file,json=sourceFile" json:"source_file,omitempty"`
// Identifies the offset in bytes in the generated code that relates to the
// identified declaration
Begin *int32 `protobuf:"varint,3,opt,name=begin" json:"begin,omitempty"`
End *int32 `protobuf:"varint,4,opt,name=end" json:"end,omitempty"`
Semantic *GeneratedCodeInfo_Annotation_Semantic `protobuf:"varint,5,opt,name=semantic,enum=google.protobuf.GeneratedCodeInfo.Annotation.Semantic" json:"semantic,omitempty"`
// Has unexported fields.
}Controls language features for editions (proto3, proto2, editions).
// FeatureSet describes features that can be set per file, message, field, etc.
type FeatureSet struct {
FieldPresence *FeatureSet_FieldPresence `protobuf:"varint,1,opt,name=field_presence,json=fieldPresence,enum=google.protobuf.FeatureSet.FieldPresence" json:"field_presence,omitempty"`
EnumType *FeatureSet_EnumType `protobuf:"varint,2,opt,name=enum_type,json=enumType,enum=google.protobuf.FeatureSet.EnumType" json:"enum_type,omitempty"`
RepeatedFieldEncoding *FeatureSet_RepeatedFieldEncoding `protobuf:"varint,3,opt,name=repeated_field_encoding,json=repeatedFieldEncoding,enum=google.protobuf.FeatureSet.RepeatedFieldEncoding" json:"repeated_field_encoding,omitempty"`
Utf8Validation *FeatureSet_Utf8Validation `protobuf:"varint,4,opt,name=utf8_validation,json=utf8Validation,enum=google.protobuf.FeatureSet.Utf8Validation" json:"utf8_validation,omitempty"`
MessageEncoding *FeatureSet_MessageEncoding `protobuf:"varint,5,opt,name=message_encoding,json=messageEncoding,enum=google.protobuf.FeatureSet.MessageEncoding" json:"message_encoding,omitempty"`
JsonFormat *FeatureSet_JsonFormat `protobuf:"varint,6,opt,name=json_format,json=jsonFormat,enum=google.protobuf.FeatureSet.JsonFormat" json:"json_format,omitempty"`
// Has unexported fields.
}
// Edition represents proto editions
type Edition int32
const (
Edition_EDITION_UNKNOWN Edition = 0
Edition_EDITION_PROTO2 Edition = 998
Edition_EDITION_PROTO3 Edition = 999
Edition_EDITION_2023 Edition = 1000
Edition_EDITION_2024 Edition = 1001
Edition_EDITION_1_TEST_ONLY Edition = 1
Edition_EDITION_2_TEST_ONLY Edition = 2
Edition_EDITION_99997_TEST_ONLY Edition = 99997
Edition_EDITION_99998_TEST_ONLY Edition = 99998
Edition_EDITION_99999_TEST_ONLY Edition = 99999
Edition_EDITION_MAX Edition = 2147483647
)Stores options that the proto compiler doesn't recognize.
// UninterpretedOption represents an option that the parser does not recognize
type UninterpretedOption struct {
Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"`
// The value of the uninterpreted option, in whatever type the tokenizer
// identified it as during parsing. Exactly one of these should be set.
IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value,json=identifierValue" json:"identifier_value,omitempty"`
PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value,json=positiveIntValue" json:"positive_int_value,omitempty"`
NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value,json=negativeIntValue" json:"negative_int_value,omitempty"`
DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"`
StringValue []byte `protobuf:"bytes,7,opt,name=string_value,json=stringValue" json:"string_value,omitempty"`
AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value,json=aggregateValue" json:"aggregate_value,omitempty"`
// Has unexported fields.
}
type UninterpretedOption_NamePart struct {
NamePart *string `protobuf:"bytes,1,req,name=name_part,json=namePart" json:"name_part,omitempty"`
IsExtension *bool `protobuf:"varint,2,req,name=is_extension,json=isExtension" json:"is_extension,omitempty"`
// Has unexported fields.
}// File descriptor for descriptor.proto
var File_google_protobuf_descriptor_proto protoreflect.FileDescriptorThese descriptor types provide a complete representation of protocol buffer definitions that can be used for code generation, runtime introspection, and dynamic message handling. They form the foundation of the protobuf reflection system.
Install with Tessl CLI
npx tessl i tessl/golang-google-golang-org--protobuf