Involved Source Filesmethods.go
Package protoreflect provides interfaces to dynamically manipulate messages.
This package includes type descriptors which describe the structure of types
defined in proto source files and value interfaces which provide the
ability to examine and manipulate the contents of messages.
Protocol Buffer Descriptors
Protobuf descriptors (e.g., EnumDescriptor or MessageDescriptor)
are immutable objects that represent protobuf type information.
They are wrappers around the messages declared in descriptor.proto.
Protobuf descriptors alone lack any information regarding Go types.
Enums and messages generated by this module implement Enum and ProtoMessage,
where the Descriptor and ProtoReflect.Descriptor accessors respectively
return the protobuf descriptor for the values.
The protobuf descriptor interfaces are not meant to be implemented by
user code since they might need to be extended in the future to support
additions to the protobuf language.
The "google.golang.org/protobuf/reflect/protodesc" package converts between
google.protobuf.DescriptorProto messages and protobuf descriptors.
Go Type Descriptors
A type descriptor (e.g., EnumType or MessageType) is a constructor for
a concrete Go type that represents the associated protobuf descriptor.
There is commonly a one-to-one relationship between protobuf descriptors and
Go type descriptors, but it can potentially be a one-to-many relationship.
Enums and messages generated by this module implement Enum and ProtoMessage,
where the Type and ProtoReflect.Type accessors respectively
return the protobuf descriptor for the values.
The "google.golang.org/protobuf/types/dynamicpb" package can be used to
create Go type descriptors from protobuf descriptors.
Value Interfaces
The Enum and Message interfaces provide a reflective view over an
enum or message instance. For enums, it provides the ability to retrieve
the enum value number for any concrete enum type. For messages, it provides
the ability to access or manipulate fields of the message.
To convert a proto.Message to a protoreflect.Message, use the
former's ProtoReflect method. Since the ProtoReflect method is new to the
v2 message interface, it may not be present on older message implementations.
The "github.com/golang/protobuf/proto".MessageReflect function can be used
to obtain a reflective view on older messages.
Relationships
The following diagrams demonstrate the relationships between
various types declared in this package.
┌───────────────────────────────────┐
V │
┌────────────── New(n) ─────────────┐ │
│ │ │
│ ┌──── Descriptor() ──┐ │ ┌── Number() ──┐ │
│ │ V V │ V │
╔════════════╗ ╔════════════════╗ ╔════════╗ ╔════════════╗
║ EnumType ║ ║ EnumDescriptor ║ ║ Enum ║ ║ EnumNumber ║
╚════════════╝ ╚════════════════╝ ╚════════╝ ╚════════════╝
Λ Λ │ │
│ └─── Descriptor() ──┘ │
│ │
└────────────────── Type() ───────┘
• An EnumType describes a concrete Go enum type.
It has an EnumDescriptor and can construct an Enum instance.
• An EnumDescriptor describes an abstract protobuf enum type.
• An Enum is a concrete enum instance. Generated enums implement Enum.
┌──────────────── New() ─────────────────┐
│ │
│ ┌─── Descriptor() ─────┐ │ ┌── Interface() ───┐
│ │ V V │ V
╔═════════════╗ ╔═══════════════════╗ ╔═════════╗ ╔══════════════╗
║ MessageType ║ ║ MessageDescriptor ║ ║ Message ║ ║ ProtoMessage ║
╚═════════════╝ ╚═══════════════════╝ ╚═════════╝ ╚══════════════╝
Λ Λ │ │ Λ │
│ └──── Descriptor() ────┘ │ └─ ProtoReflect() ─┘
│ │
└─────────────────── Type() ─────────┘
• A MessageType describes a concrete Go message type.
It has a MessageDescriptor and can construct a Message instance.
• A MessageDescriptor describes an abstract protobuf message type.
• A Message is a concrete message instance. Generated messages implement
ProtoMessage, which can convert to/from a Message.
┌── TypeDescriptor() ──┐ ┌───── Descriptor() ─────┐
│ V │ V
╔═══════════════╗ ╔═════════════════════════╗ ╔═════════════════════╗
║ ExtensionType ║ ║ ExtensionTypeDescriptor ║ ║ ExtensionDescriptor ║
╚═══════════════╝ ╚═════════════════════════╝ ╚═════════════════════╝
Λ │ │ Λ │ Λ
└─────── Type() ───────┘ │ └─── may implement ────┘ │
│ │
└────── implements ────────┘
• An ExtensionType describes a concrete Go implementation of an extension.
It has an ExtensionTypeDescriptor and can convert to/from
abstract Values and Go values.
• An ExtensionTypeDescriptor is an ExtensionDescriptor
which also has an ExtensionType.
• An ExtensionDescriptor describes an abstract protobuf extension field and
may not always be an ExtensionTypeDescriptor.
source.gosource_gen.gotype.govalue.govalue_union.govalue_unsafe.go
Package-Level Type Names (total 76, in which 47 are exported)
Descriptor provides a set of accessors that are common to every descriptor.
Each descriptor type wraps the equivalent google.protobuf.XXXDescriptorProto,
but provides efficient lookup and immutability.
Each descriptor is comparable. Equality implies that the two types are
exactly identical. However, it is possible for the same semantically
identical proto type to be represented by multiple type descriptors.
For example, suppose we have t1 and t2 which are both MessageDescriptors.
If t1 == t2, then the types are definitely equal and all accessors return
the same information. However, if t1 != t2, then it is still possible that
they still represent the same proto type (e.g., t1.FullName == t2.FullName).
This can occur if a descriptor type is created dynamically, or multiple
versions of the same proto type are accidentally linked into the Go binary.
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
( T) ProtoInternal(pragma.DoNotImplement)
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
EnumDescriptor(interface)EnumValueDescriptor(interface)ExtensionTypeDescriptor(interface)FieldDescriptor(interface)FileDescriptor(interface)FileImportMessageDescriptor(interface)MethodDescriptor(interface)OneofDescriptor(interface)ServiceDescriptor(interface)
*google.golang.org/protobuf/internal/filedesc.Enum
*google.golang.org/protobuf/internal/filedesc.EnumValue
*google.golang.org/protobuf/internal/filedesc.Extension
*google.golang.org/protobuf/internal/filedesc.Field
*google.golang.org/protobuf/internal/filedesc.File
*google.golang.org/protobuf/internal/filedesc.Message
*google.golang.org/protobuf/internal/filedesc.Method
*google.golang.org/protobuf/internal/filedesc.Oneof
google.golang.org/protobuf/internal/filedesc.PlaceholderEnum
google.golang.org/protobuf/internal/filedesc.PlaceholderEnumValue
google.golang.org/protobuf/internal/filedesc.PlaceholderFile
google.golang.org/protobuf/internal/filedesc.PlaceholderMessage
*google.golang.org/protobuf/internal/filedesc.Service
google.golang.org/protobuf/internal/impl.extensionTypeDescriptor
google.golang.org/protobuf/internal/impl.placeholderExtension
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
func Descriptor.Parent() Descriptor
func EnumDescriptor.Parent() Descriptor
func EnumValueDescriptor.Parent() Descriptor
func ExtensionDescriptor.Parent() Descriptor
func ExtensionTypeDescriptor.Parent() Descriptor
func FieldDescriptor.Parent() Descriptor
func FileDescriptor.Parent() Descriptor
func MessageDescriptor.Parent() Descriptor
func MethodDescriptor.Parent() Descriptor
func OneofDescriptor.Parent() Descriptor
func ServiceDescriptor.Parent() Descriptor
func google.golang.org/protobuf/reflect/protodesc.Resolver.FindDescriptorByName(FullName) (Descriptor, error)
func google.golang.org/protobuf/reflect/protoregistry.(*Files).FindDescriptorByName(name FullName) (Descriptor, error)
func google.golang.org/protobuf/internal/filedesc.(*Base).Parent() Descriptor
func google.golang.org/protobuf/internal/filedesc.(*File).Parent() Descriptor
func google.golang.org/protobuf/internal/filedesc.PlaceholderEnum.Parent() Descriptor
func google.golang.org/protobuf/internal/filedesc.PlaceholderEnumValue.Parent() Descriptor
func google.golang.org/protobuf/internal/filedesc.PlaceholderFile.Parent() Descriptor
func google.golang.org/protobuf/internal/filedesc.PlaceholderMessage.Parent() Descriptor
func google.golang.org/protobuf/reflect/protoregistry.findDescriptorInMessage(md MessageDescriptor, suffix protoregistry.nameSuffix) Descriptor
func SourceLocations.ByDescriptor(desc Descriptor) SourceLocation
func google.golang.org/protobuf/internal/descfmt.FormatDesc(s fmt.State, r rune, t Descriptor)
func google.golang.org/protobuf/internal/filedesc.(*SourceLocations).ByDescriptor(desc Descriptor) SourceLocation
func google.golang.org/protobuf/reflect/protodesc.fullNameOf(d Descriptor) *string
func google.golang.org/protobuf/reflect/protoregistry.(*Types).register(kind string, desc Descriptor, typ interface{}) error
func google.golang.org/protobuf/internal/descfmt.formatDescOpt(t Descriptor, isRoot, allowMulti bool) string
func google.golang.org/protobuf/internal/filedesc.(*Enum).unmarshalSeed(b []byte, sb *strs.Builder, pf *filedesc.File, pd Descriptor, i int)
func google.golang.org/protobuf/internal/filedesc.(*EnumValue).unmarshalFull(b []byte, sb *strs.Builder, pf *filedesc.File, pd Descriptor, i int)
func google.golang.org/protobuf/internal/filedesc.(*Extension).unmarshalSeed(b []byte, sb *strs.Builder, pf *filedesc.File, pd Descriptor, i int)
func google.golang.org/protobuf/internal/filedesc.(*Field).unmarshalFull(b []byte, sb *strs.Builder, pf *filedesc.File, pd Descriptor, i int)
func google.golang.org/protobuf/internal/filedesc.(*Message).unmarshalSeed(b []byte, sb *strs.Builder, pf *filedesc.File, pd Descriptor, i int)
func google.golang.org/protobuf/internal/filedesc.(*Method).unmarshalFull(b []byte, sb *strs.Builder, pf *filedesc.File, pd Descriptor, i int)
func google.golang.org/protobuf/internal/filedesc.(*Oneof).unmarshalFull(b []byte, sb *strs.Builder, pf *filedesc.File, pd Descriptor, i int)
func google.golang.org/protobuf/internal/filedesc.(*Service).unmarshalSeed(b []byte, sb *strs.Builder, pf *filedesc.File, pd Descriptor, i int)
Enum is a reflection interface for a concrete enum value,
which provides type information and a getter for the enum number.
Enum does not provide a mutable API since enums are commonly backed by
Go constants, which are not addressable.
Descriptor returns enum descriptor, which contains only the protobuf
type information for the enum.
Number returns the enum value as an integer.
Type returns the enum type, which encapsulates both Go and protobuf
type information. If the Go type information is not needed,
it is recommended that the enum descriptor be used instead.
google.golang.org/protobuf/types/descriptorpb.FieldDescriptorProto_Label
google.golang.org/protobuf/types/descriptorpb.FieldDescriptorProto_Type
google.golang.org/protobuf/types/descriptorpb.FieldOptions_CType
google.golang.org/protobuf/types/descriptorpb.FieldOptions_JSType
google.golang.org/protobuf/types/descriptorpb.FileOptions_OptimizeMode
google.golang.org/protobuf/types/descriptorpb.MethodOptions_IdempotencyLevel
google.golang.org/genproto/googleapis/api/annotations.FieldBehavior
google.golang.org/genproto/googleapis/api/annotations.ResourceDescriptor_History
google.golang.org/genproto/googleapis/api/annotations.ResourceDescriptor_Style
google.golang.org/genproto/googleapis/logging/type.LogSeverity
*google.golang.org/protobuf/internal/impl.legacyEnumWrapper
func EnumType.New(n EnumNumber) Enum
func google.golang.org/protobuf/internal/impl.(*EnumInfo).New(n EnumNumber) Enum
func google.golang.org/protobuf/internal/impl.Export.EnumOf(e impl.enum) Enum
func google.golang.org/protobuf/internal/impl.legacyWrapEnum(v reflect.Value) Enum
EnumDescriptor describes an enum and
corresponds with the google.protobuf.EnumDescriptorProto message.
Nested declarations:
EnumValueDescriptor.
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
( T) ProtoInternal(pragma.DoNotImplement)( T) ProtoType(EnumDescriptor)
ReservedNames is a list of reserved enum names.
ReservedRanges is a list of reserved ranges of enum numbers.
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
Values is a list of nested enum value declarations.
*google.golang.org/protobuf/internal/filedesc.Enum
google.golang.org/protobuf/internal/filedesc.PlaceholderEnum
T : Descriptor
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : isEnumDescriptor
func Enum.Descriptor() EnumDescriptor
func EnumDescriptors.ByName(s Name) EnumDescriptor
func EnumDescriptors.Get(i int) EnumDescriptor
func EnumType.Descriptor() EnumDescriptor
func ExtensionDescriptor.Enum() EnumDescriptor
func ExtensionTypeDescriptor.Enum() EnumDescriptor
func FieldDescriptor.Enum() EnumDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Enums).ByName(s Name) EnumDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Enums).Get(i int) EnumDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Extension).Enum() EnumDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Field).Enum() EnumDescriptor
func google.golang.org/protobuf/internal/impl.LegacyLoadEnumDesc(t reflect.Type) EnumDescriptor
func google.golang.org/protobuf/internal/impl.(*EnumInfo).Descriptor() EnumDescriptor
func google.golang.org/protobuf/internal/impl.Export.EnumDescriptorOf(e impl.enum) EnumDescriptor
func google.golang.org/protobuf/types/descriptorpb.FieldDescriptorProto_Label.Descriptor() EnumDescriptor
func google.golang.org/protobuf/types/descriptorpb.FieldDescriptorProto_Type.Descriptor() EnumDescriptor
func google.golang.org/protobuf/types/descriptorpb.FieldOptions_CType.Descriptor() EnumDescriptor
func google.golang.org/protobuf/types/descriptorpb.FieldOptions_JSType.Descriptor() EnumDescriptor
func google.golang.org/protobuf/types/descriptorpb.FileOptions_OptimizeMode.Descriptor() EnumDescriptor
func google.golang.org/protobuf/types/descriptorpb.MethodOptions_IdempotencyLevel.Descriptor() EnumDescriptor
func google.golang.org/genproto/googleapis/api/annotations.FieldBehavior.Descriptor() EnumDescriptor
func google.golang.org/genproto/googleapis/api/annotations.ResourceDescriptor_History.Descriptor() EnumDescriptor
func google.golang.org/genproto/googleapis/api/annotations.ResourceDescriptor_Style.Descriptor() EnumDescriptor
func google.golang.org/genproto/googleapis/logging/type.LogSeverity.Descriptor() EnumDescriptor
func google.golang.org/protobuf/internal/filedesc.(*File).resolveEnumDependency(ed EnumDescriptor, i, j int32) EnumDescriptor
func google.golang.org/protobuf/internal/impl.aberrantLoadEnumDesc(t reflect.Type) EnumDescriptor
func EnumDescriptor.ProtoType(EnumDescriptor)
func google.golang.org/protobuf/reflect/protodesc.ToEnumDescriptorProto(enum EnumDescriptor) *descriptorpb.EnumDescriptorProto
func google.golang.org/protobuf/internal/filedesc.(*Enum).ProtoType(EnumDescriptor)
func google.golang.org/protobuf/internal/filedesc.PlaceholderEnum.ProtoType(EnumDescriptor)
func google.golang.org/protobuf/internal/impl.Export.EnumStringOf(ed EnumDescriptor, n EnumNumber) string
func google.golang.org/protobuf/internal/impl.Export.LegacyEnumName(ed EnumDescriptor) string
func google.golang.org/protobuf/internal/impl.Export.UnmarshalJSONEnum(ed EnumDescriptor, b []byte) (EnumNumber, error)
func google.golang.org/protobuf/internal/filedesc.unmarshalDefault(b []byte, k Kind, pf *filedesc.File, ed EnumDescriptor) filedesc.defaultValue
func google.golang.org/protobuf/internal/filedesc.(*File).resolveEnumDependency(ed EnumDescriptor, i, j int32) EnumDescriptor
func google.golang.org/protobuf/internal/impl.legacyEnumName(ed EnumDescriptor) string
EnumDescriptors is a list of enum declarations.
ByName returns the EnumDescriptor for an enum named s.
It returns nil if not found.
Get returns the ith EnumDescriptor. It panics if out of bounds.
Len reports the number of enum types.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.Enums
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func FileDescriptor.Enums() EnumDescriptors
func MessageDescriptor.Enums() EnumDescriptors
func google.golang.org/protobuf/internal/filedesc.(*File).Enums() EnumDescriptors
func google.golang.org/protobuf/internal/filedesc.(*Message).Enums() EnumDescriptors
func google.golang.org/protobuf/internal/filedesc.PlaceholderFile.Enums() EnumDescriptors
func google.golang.org/protobuf/internal/filedesc.PlaceholderMessage.Enums() EnumDescriptors
EnumRanges represent a list of enum number ranges.
Get returns the ith range. It panics if out of bounds.
// start inclusive; end inclusive
Has reports whether n is within any of the ranges.
Len reports the number of ranges in the list.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.EnumRanges
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func EnumDescriptor.ReservedRanges() EnumRanges
func google.golang.org/protobuf/internal/filedesc.(*Enum).ReservedRanges() EnumRanges
func google.golang.org/protobuf/internal/filedesc.PlaceholderEnum.ReservedRanges() EnumRanges
EnumType encapsulates an EnumDescriptor with a concrete Go implementation.
Descriptor returns the enum descriptor.
Invariant: t.Descriptor() == t.New(0).Descriptor()
New returns an instance of this enum type with its value set to n.
*google.golang.org/protobuf/internal/impl.EnumInfo
*google.golang.org/protobuf/internal/impl.legacyEnumType
func Enum.Type() EnumType
func MessageFieldTypes.Enum(i int) EnumType
func google.golang.org/protobuf/reflect/protoregistry.(*Types).FindEnumByName(enum FullName) (EnumType, error)
func google.golang.org/protobuf/internal/impl.Export.EnumTypeOf(e impl.enum) EnumType
func google.golang.org/protobuf/internal/impl.(*MessageInfo).Enum(i int) EnumType
func google.golang.org/protobuf/types/descriptorpb.FieldDescriptorProto_Label.Type() EnumType
func google.golang.org/protobuf/types/descriptorpb.FieldDescriptorProto_Type.Type() EnumType
func google.golang.org/protobuf/types/descriptorpb.FieldOptions_CType.Type() EnumType
func google.golang.org/protobuf/types/descriptorpb.FieldOptions_JSType.Type() EnumType
func google.golang.org/protobuf/types/descriptorpb.FileOptions_OptimizeMode.Type() EnumType
func google.golang.org/protobuf/types/descriptorpb.MethodOptions_IdempotencyLevel.Type() EnumType
func google.golang.org/genproto/googleapis/api/annotations.FieldBehavior.Type() EnumType
func google.golang.org/genproto/googleapis/api/annotations.ResourceDescriptor_History.Type() EnumType
func google.golang.org/genproto/googleapis/api/annotations.ResourceDescriptor_Style.Type() EnumType
func google.golang.org/genproto/googleapis/logging/type.LogSeverity.Type() EnumType
func google.golang.org/protobuf/internal/impl.legacyLoadEnumType(t reflect.Type) EnumType
func google.golang.org/protobuf/reflect/protoregistry.(*Types).RegisterEnum(et EnumType) error
func github.com/golang/protobuf/proto.enumGoType(et EnumType) reflect.Type
EnumValueDescriptor describes an enum value and
corresponds with the google.protobuf.EnumValueDescriptorProto message.
All other proto declarations are in the namespace of the parent.
However, enum values do not follow this rule and are within the namespace
of the parent's parent (i.e., they are a sibling of the containing enum).
Thus, a value named "FOO_VALUE" declared within an enum uniquely identified
as "proto.package.MyEnum" has a full name of "proto.package.FOO_VALUE".
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Number returns the enum value as an integer.
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
( T) ProtoInternal(pragma.DoNotImplement)( T) ProtoType(EnumValueDescriptor)
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
*google.golang.org/protobuf/internal/filedesc.EnumValue
google.golang.org/protobuf/internal/filedesc.PlaceholderEnumValue
T : Descriptor
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : isEnumValueDescriptor
func EnumValueDescriptors.ByName(s Name) EnumValueDescriptor
func EnumValueDescriptors.ByNumber(n EnumNumber) EnumValueDescriptor
func EnumValueDescriptors.Get(i int) EnumValueDescriptor
func ExtensionDescriptor.DefaultEnumValue() EnumValueDescriptor
func ExtensionTypeDescriptor.DefaultEnumValue() EnumValueDescriptor
func FieldDescriptor.DefaultEnumValue() EnumValueDescriptor
func google.golang.org/protobuf/internal/encoding/defval.Unmarshal(s string, k Kind, evs EnumValueDescriptors, f defval.Format) (Value, EnumValueDescriptor, error)
func google.golang.org/protobuf/internal/filedesc.(*EnumValues).ByName(s Name) EnumValueDescriptor
func google.golang.org/protobuf/internal/filedesc.(*EnumValues).ByNumber(n EnumNumber) EnumValueDescriptor
func google.golang.org/protobuf/internal/filedesc.(*EnumValues).Get(i int) EnumValueDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Extension).DefaultEnumValue() EnumValueDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Field).DefaultEnumValue() EnumValueDescriptor
func google.golang.org/protobuf/reflect/protodesc.unmarshalDefault(s string, fd FieldDescriptor, allowUnresolvable bool) (Value, EnumValueDescriptor, error)
func EnumValueDescriptor.ProtoType(EnumValueDescriptor)
func google.golang.org/protobuf/reflect/protodesc.ToEnumValueDescriptorProto(value EnumValueDescriptor) *descriptorpb.EnumValueDescriptorProto
func google.golang.org/protobuf/internal/encoding/defval.Marshal(v Value, ev EnumValueDescriptor, k Kind, f defval.Format) (string, error)
func google.golang.org/protobuf/internal/filedesc.DefaultValue(v Value, ev EnumValueDescriptor) filedesc.defaultValue
func google.golang.org/protobuf/internal/filedesc.(*EnumValue).ProtoType(EnumValueDescriptor)
func google.golang.org/protobuf/internal/filedesc.PlaceholderEnumValue.ProtoType(EnumValueDescriptor)
EnumValueDescriptors is a list of enum value declarations.
ByName returns the EnumValueDescriptor for the enum value named s.
It returns nil if not found.
ByNumber returns the EnumValueDescriptor for the enum value numbered n.
If multiple have the same number, the first one defined is returned
It returns nil if not found.
Get returns the ith EnumValueDescriptor. It panics if out of bounds.
Len reports the number of enum values.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.EnumValues
google.golang.org/protobuf/internal/impl.placeholderEnumValues
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func EnumDescriptor.Values() EnumValueDescriptors
func google.golang.org/protobuf/internal/filedesc.(*Enum).Values() EnumValueDescriptors
func google.golang.org/protobuf/internal/filedesc.PlaceholderEnum.Values() EnumValueDescriptors
func google.golang.org/protobuf/internal/encoding/defval.Unmarshal(s string, k Kind, evs EnumValueDescriptors, f defval.Format) (Value, EnumValueDescriptor, error)
func google.golang.org/protobuf/internal/encoding/tag.Unmarshal(tag string, goType reflect.Type, evs EnumValueDescriptors) FieldDescriptor
ExtensionDescriptor is an alias of FieldDescriptor for documentation.
ExtensionDescriptors is a list of field declarations.
ByName returns the ExtensionDescriptor for a field named s.
It returns nil if not found.
Get returns the ith ExtensionDescriptor. It panics if out of bounds.
Len reports the number of fields.
( T) ProtoInternal(pragma.DoNotImplement)FieldDescriptors(interface)
*google.golang.org/protobuf/internal/filedesc.Extensions
*google.golang.org/protobuf/internal/filedesc.Fields
*google.golang.org/protobuf/internal/filedesc.OneofFields
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func FileDescriptor.Extensions() ExtensionDescriptors
func MessageDescriptor.Extensions() ExtensionDescriptors
func google.golang.org/protobuf/internal/filedesc.(*File).Extensions() ExtensionDescriptors
func google.golang.org/protobuf/internal/filedesc.(*Message).Extensions() ExtensionDescriptors
func google.golang.org/protobuf/internal/filedesc.PlaceholderFile.Extensions() ExtensionDescriptors
func google.golang.org/protobuf/internal/filedesc.PlaceholderMessage.Extensions() ExtensionDescriptors
ExtensionType encapsulates an ExtensionDescriptor with a concrete
Go implementation. The nested field descriptor must be for a extension field.
While a normal field is a member of the parent message that it is declared
within (see Descriptor.Parent), an extension field is a member of some other
target message (see ExtensionDescriptor.Extendee) and may have no
relationship with the parent. However, the full name of an extension field is
relative to the parent that it is declared within.
For example:
syntax = "proto2";
package example;
message FooMessage {
extensions 100 to max;
}
message BarMessage {
extends FooMessage { optional BarMessage bar_field = 100; }
}
Field "bar_field" is an extension of FooMessage, but its full name is
"example.BarMessage.bar_field" instead of "example.FooMessage.bar_field".
InterfaceOf completely unwraps the Value to the underlying Go type.
InterfaceOf panics if the input is nil or does not represent the
appropriate underlying Go type. For composite types, it panics if the
value is not mutable.
InterfaceOf is able to unwrap the Value further than Value.Interface
as it has more type information available.
IsValidInterface reports whether the input is valid to assign to the field.
IsValidValue reports whether the Value is valid to assign to the field.
New returns a new value for the field.
For scalars, this returns the default value in native Go form.
TypeDescriptor returns the extension type descriptor.
ValueOf wraps the input and returns it as a Value.
ValueOf panics if the input value is invalid or not the appropriate type.
ValueOf is more extensive than protoreflect.ValueOf for a given field's
value as it has more type information available.
Zero returns a new value for the field.
For scalars, this returns the default value in native Go form.
For composite types, this returns an empty, read-only message, list, or map.
*google.golang.org/protobuf/internal/impl.ExtensionInfo
func ExtensionTypeDescriptor.Type() ExtensionType
func google.golang.org/protobuf/reflect/protoregistry.ExtensionTypeResolver.FindExtensionByName(field FullName) (ExtensionType, error)
func google.golang.org/protobuf/reflect/protoregistry.ExtensionTypeResolver.FindExtensionByNumber(message FullName, field FieldNumber) (ExtensionType, error)
func google.golang.org/protobuf/reflect/protoregistry.(*Types).FindExtensionByName(field FullName) (ExtensionType, error)
func google.golang.org/protobuf/reflect/protoregistry.(*Types).FindExtensionByNumber(message FullName, field FieldNumber) (ExtensionType, error)
func google.golang.org/protobuf/internal/impl.ExtensionField.Type() ExtensionType
func google.golang.org/protobuf/internal/impl.(*MessageInfo).checkField(fd FieldDescriptor) (*impl.fieldInfo, ExtensionType)
func google.golang.org/protobuf/reflect/protoregistry.(*Types).RegisterExtension(xt ExtensionType) error
func google.golang.org/protobuf/internal/impl.(*ExtensionField).Set(t ExtensionType, v Value)
func google.golang.org/protobuf/internal/impl.(*ExtensionField).SetLazy(t ExtensionType, fn func() Value)
func google.golang.org/protobuf/proto.ClearExtension(m proto.Message, xt ExtensionType)
func google.golang.org/protobuf/proto.GetExtension(m proto.Message, xt ExtensionType) interface{}
func google.golang.org/protobuf/proto.HasExtension(m proto.Message, xt ExtensionType) bool
func google.golang.org/protobuf/proto.SetExtension(m proto.Message, xt ExtensionType, v interface{})
func google.golang.org/protobuf/internal/impl.getExtensionFieldInfo(xt ExtensionType) *impl.extensionFieldInfo
func google.golang.org/protobuf/internal/impl.legacyLoadExtensionFieldInfo(xt ExtensionType) *impl.extensionFieldInfo
func google.golang.org/protobuf/internal/impl.(*ExtensionField).appendLazyBytes(xt ExtensionType, xi *impl.extensionFieldInfo, num protowire.Number, wtyp protowire.Type, b []byte)
func google.golang.org/protobuf/internal/impl.(*ExtensionField).canLazy(xt ExtensionType) bool
ExtensionTypeDescriptor is an ExtensionDescriptor with an associated ExtensionType.
Cardinality reports the cardinality for this field.
ContainingMessage is the containing message that this field belongs to.
For extension fields, this may not necessarily be the parent message
that the field is declared within.
ContainingOneof is the containing oneof that this field belongs to,
and is nil if this field is not part of a oneof.
Default returns the default value for scalar fields.
For proto2, it is the default value as specified in the proto file,
or the zero value if unspecified.
For proto3, it is always the zero value of the scalar.
The Value type is determined by the Kind.
DefaultEnumValue returns the enum value descriptor for the default value
of an enum field, and is nil for any other kind of field.
Descriptor returns the plain ExtensionDescriptor without the
associated ExtensionType.
Enum is the enum descriptor if Kind is EnumKind.
It returns nil for any other Kind.
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
HasDefault reports whether this field has a default value.
HasJSONName reports whether this field has an explicitly set JSON name.
HasOptionalKeyword reports whether the "optional" keyword was explicitly
specified in the source .proto file.
HasPresence reports whether the field distinguishes between unpopulated
and default values.
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
IsExtension reports whether this is an extension field. If false,
then Parent and ContainingMessage refer to the same message.
Otherwise, ContainingMessage and Parent likely differ.
IsList reports whether this field represents a list,
where the value type for the associated field is a List.
It is equivalent to checking whether Cardinality is Repeated and
that IsMap reports false.
IsMap reports whether this field represents a map,
where the value type for the associated field is a Map.
It is equivalent to checking whether Cardinality is Repeated,
that the Kind is MessageKind, and that Message.IsMapEntry reports true.
IsPacked reports whether repeated primitive numeric kinds should be
serialized using a packed encoding.
If true, then it implies Cardinality is Repeated.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
IsWeak reports whether this is a weak field, which does not impose a
direct dependency on the target type.
If true, then Message returns a placeholder type.
JSONName reports the name used for JSON serialization.
It is usually the camel-cased form of the field name.
Extension fields are represented by the full name surrounded by brackets.
Kind reports the basic kind for this field.
MapKey returns the field descriptor for the key in the map entry.
It returns nil if IsMap reports false.
MapValue returns the field descriptor for the value in the map entry.
It returns nil if IsMap reports false.
Message is the message descriptor if Kind is
MessageKind or GroupKind. It returns nil for any other Kind.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Number reports the unique number for this field.
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
( T) ProtoInternal(pragma.DoNotImplement)( T) ProtoType(FieldDescriptor)
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
TextName reports the name used for text serialization.
It is usually the name of the field, except that groups use the name
of the inlined message, and extension fields are represented by the
full name surrounded by brackets.
Type returns the associated ExtensionType.
*google.golang.org/protobuf/internal/impl.extensionTypeDescriptor
T : Descriptor
T : FieldDescriptor
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : isFieldDescriptor
func ExtensionType.TypeDescriptor() ExtensionTypeDescriptor
func google.golang.org/protobuf/internal/impl.(*ExtensionInfo).TypeDescriptor() ExtensionTypeDescriptor
func github.com/golang/protobuf/proto.isValidExtension(md MessageDescriptor, xtd ExtensionTypeDescriptor) bool
FieldDescriptor describes a field within a message and
corresponds with the google.protobuf.FieldDescriptorProto message.
It is used for both normal fields defined within the parent message
(e.g., MessageDescriptor.Fields) and fields that extend some remote message
(e.g., FileDescriptor.Extensions or MessageDescriptor.Extensions).
Cardinality reports the cardinality for this field.
ContainingMessage is the containing message that this field belongs to.
For extension fields, this may not necessarily be the parent message
that the field is declared within.
ContainingOneof is the containing oneof that this field belongs to,
and is nil if this field is not part of a oneof.
Default returns the default value for scalar fields.
For proto2, it is the default value as specified in the proto file,
or the zero value if unspecified.
For proto3, it is always the zero value of the scalar.
The Value type is determined by the Kind.
DefaultEnumValue returns the enum value descriptor for the default value
of an enum field, and is nil for any other kind of field.
Enum is the enum descriptor if Kind is EnumKind.
It returns nil for any other Kind.
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
HasDefault reports whether this field has a default value.
HasJSONName reports whether this field has an explicitly set JSON name.
HasOptionalKeyword reports whether the "optional" keyword was explicitly
specified in the source .proto file.
HasPresence reports whether the field distinguishes between unpopulated
and default values.
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
IsExtension reports whether this is an extension field. If false,
then Parent and ContainingMessage refer to the same message.
Otherwise, ContainingMessage and Parent likely differ.
IsList reports whether this field represents a list,
where the value type for the associated field is a List.
It is equivalent to checking whether Cardinality is Repeated and
that IsMap reports false.
IsMap reports whether this field represents a map,
where the value type for the associated field is a Map.
It is equivalent to checking whether Cardinality is Repeated,
that the Kind is MessageKind, and that Message.IsMapEntry reports true.
IsPacked reports whether repeated primitive numeric kinds should be
serialized using a packed encoding.
If true, then it implies Cardinality is Repeated.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
IsWeak reports whether this is a weak field, which does not impose a
direct dependency on the target type.
If true, then Message returns a placeholder type.
JSONName reports the name used for JSON serialization.
It is usually the camel-cased form of the field name.
Extension fields are represented by the full name surrounded by brackets.
Kind reports the basic kind for this field.
MapKey returns the field descriptor for the key in the map entry.
It returns nil if IsMap reports false.
MapValue returns the field descriptor for the value in the map entry.
It returns nil if IsMap reports false.
Message is the message descriptor if Kind is
MessageKind or GroupKind. It returns nil for any other Kind.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Number reports the unique number for this field.
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
( T) ProtoInternal(pragma.DoNotImplement)( T) ProtoType(FieldDescriptor)
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
TextName reports the name used for text serialization.
It is usually the name of the field, except that groups use the name
of the inlined message, and extension fields are represented by the
full name surrounded by brackets.
ExtensionTypeDescriptor(interface)
*google.golang.org/protobuf/internal/filedesc.Extension
*google.golang.org/protobuf/internal/filedesc.Field
google.golang.org/protobuf/internal/impl.extensionTypeDescriptor
google.golang.org/protobuf/internal/impl.placeholderExtension
T : Descriptor
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : isFieldDescriptor
func ExtensionDescriptor.MapKey() FieldDescriptor
func ExtensionDescriptor.MapValue() FieldDescriptor
func ExtensionDescriptors.ByName(s Name) ExtensionDescriptor
func ExtensionDescriptors.Get(i int) ExtensionDescriptor
func ExtensionTypeDescriptor.Descriptor() ExtensionDescriptor
func ExtensionTypeDescriptor.MapKey() FieldDescriptor
func ExtensionTypeDescriptor.MapValue() FieldDescriptor
func FieldDescriptor.MapKey() FieldDescriptor
func FieldDescriptor.MapValue() FieldDescriptor
func FieldDescriptors.ByJSONName(s string) FieldDescriptor
func FieldDescriptors.ByName(s Name) FieldDescriptor
func FieldDescriptors.ByNumber(n FieldNumber) FieldDescriptor
func FieldDescriptors.ByTextName(s string) FieldDescriptor
func FieldDescriptors.Get(i int) FieldDescriptor
func Message.WhichOneof(OneofDescriptor) FieldDescriptor
func google.golang.org/protobuf/internal/encoding/tag.Unmarshal(tag string, goType reflect.Type, evs EnumValueDescriptors) FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Extension).MapKey() FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Extension).MapValue() FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Extensions).ByName(s Name) ExtensionDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Extensions).Get(i int) ExtensionDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Field).MapKey() FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Field).MapValue() FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Fields).ByJSONName(s string) FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Fields).ByName(s Name) FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Fields).ByNumber(n FieldNumber) FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Fields).ByTextName(s string) FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Fields).Get(i int) FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*OneofFields).ByJSONName(s string) FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*OneofFields).ByName(s Name) FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*OneofFields).ByNumber(n FieldNumber) FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*OneofFields).ByTextName(s string) FieldDescriptor
func google.golang.org/protobuf/internal/filedesc.(*OneofFields).Get(i int) FieldDescriptor
func ExtensionDescriptor.ProtoType(FieldDescriptor)
func ExtensionTypeDescriptor.ProtoType(FieldDescriptor)
func FieldDescriptor.ProtoType(FieldDescriptor)
func Message.Clear(FieldDescriptor)
func Message.Get(FieldDescriptor) Value
func Message.Has(FieldDescriptor) bool
func Message.Mutable(FieldDescriptor) Value
func Message.NewField(FieldDescriptor) Value
func Message.Set(FieldDescriptor, Value)
func google.golang.org/protobuf/reflect/protodesc.ToFieldDescriptorProto(field FieldDescriptor) *descriptorpb.FieldDescriptorProto
func google.golang.org/protobuf/internal/encoding/messageset.IsMessageSetExtension(fd FieldDescriptor) bool
func google.golang.org/protobuf/internal/encoding/tag.Marshal(fd FieldDescriptor, enumName string) string
func google.golang.org/protobuf/internal/filedesc.(*Extension).ProtoType(FieldDescriptor)
func google.golang.org/protobuf/internal/filedesc.(*Field).ProtoType(FieldDescriptor)
func google.golang.org/protobuf/internal/impl.InitExtensionInfo(xi *impl.ExtensionInfo, xd ExtensionDescriptor, goType reflect.Type)
func google.golang.org/protobuf/internal/impl.IsLazy(m Message, fd FieldDescriptor) bool
func google.golang.org/protobuf/internal/impl.NewConverter(t reflect.Type, fd FieldDescriptor) impl.Converter
func google.golang.org/protobuf/internal/strs.EnforceUTF8(fd FieldDescriptor) bool
func google.golang.org/protobuf/reflect/protodesc.checkValidGroup(fd FieldDescriptor) error
func google.golang.org/protobuf/reflect/protodesc.checkValidMap(fd FieldDescriptor) error
func google.golang.org/protobuf/reflect/protodesc.isOptionalMessage(fd FieldDescriptor) bool
func google.golang.org/protobuf/reflect/protodesc.isPackable(fd FieldDescriptor) bool
func google.golang.org/protobuf/reflect/protodesc.unmarshalDefault(s string, fd FieldDescriptor, allowUnresolvable bool) (Value, EnumValueDescriptor, error)
func google.golang.org/protobuf/internal/impl.encoderFuncsForMap(fd FieldDescriptor, ft reflect.Type) (valueMessage *impl.MessageInfo, funcs impl.pointerCoderFuncs)
func google.golang.org/protobuf/internal/impl.encoderFuncsForValue(fd FieldDescriptor) impl.valueCoderFuncs
func google.golang.org/protobuf/internal/impl.fieldCoder(fd FieldDescriptor, ft reflect.Type) (*impl.MessageInfo, impl.pointerCoderFuncs)
func google.golang.org/protobuf/internal/impl.fieldInfoForList(fd FieldDescriptor, fs reflect.StructField, x impl.exporter) impl.fieldInfo
func google.golang.org/protobuf/internal/impl.fieldInfoForMap(fd FieldDescriptor, fs reflect.StructField, x impl.exporter) impl.fieldInfo
func google.golang.org/protobuf/internal/impl.fieldInfoForMessage(fd FieldDescriptor, fs reflect.StructField, x impl.exporter) impl.fieldInfo
func google.golang.org/protobuf/internal/impl.fieldInfoForMissing(fd FieldDescriptor) impl.fieldInfo
func google.golang.org/protobuf/internal/impl.fieldInfoForOneof(fd FieldDescriptor, fs reflect.StructField, x impl.exporter, ot reflect.Type) impl.fieldInfo
func google.golang.org/protobuf/internal/impl.fieldInfoForScalar(fd FieldDescriptor, fs reflect.StructField, x impl.exporter) impl.fieldInfo
func google.golang.org/protobuf/internal/impl.fieldInfoForWeakMessage(fd FieldDescriptor, weakOffset impl.offset) impl.fieldInfo
func google.golang.org/protobuf/internal/impl.makeExtensionFieldInfo(xd ExtensionDescriptor) *impl.extensionFieldInfo
func google.golang.org/protobuf/internal/impl.makeGroupFieldCoder(fd FieldDescriptor, ft reflect.Type) impl.pointerCoderFuncs
func google.golang.org/protobuf/internal/impl.makeGroupSliceFieldCoder(fd FieldDescriptor, ft reflect.Type) impl.pointerCoderFuncs
func google.golang.org/protobuf/internal/impl.makeMessageFieldCoder(fd FieldDescriptor, ft reflect.Type) impl.pointerCoderFuncs
func google.golang.org/protobuf/internal/impl.makeMessageSliceFieldCoder(fd FieldDescriptor, ft reflect.Type) impl.pointerCoderFuncs
func google.golang.org/protobuf/internal/impl.makeWeakMessageFieldCoder(fd FieldDescriptor) impl.pointerCoderFuncs
func google.golang.org/protobuf/internal/impl.newEnumConverter(goType reflect.Type, fd FieldDescriptor) impl.Converter
func google.golang.org/protobuf/internal/impl.newFieldValidationInfo(mi *impl.MessageInfo, si impl.structInfo, fd FieldDescriptor, ft reflect.Type) impl.validationInfo
func google.golang.org/protobuf/internal/impl.newListConverter(t reflect.Type, fd FieldDescriptor) impl.Converter
func google.golang.org/protobuf/internal/impl.newMapConverter(t reflect.Type, fd FieldDescriptor) *impl.mapConverter
func google.golang.org/protobuf/internal/impl.newSingularConverter(t reflect.Type, fd FieldDescriptor) impl.Converter
func google.golang.org/protobuf/internal/impl.newValidationInfo(fd FieldDescriptor, ft reflect.Type) impl.validationInfo
func google.golang.org/protobuf/internal/impl.(*MessageInfo).checkField(fd FieldDescriptor) (*impl.fieldInfo, ExtensionType)
func google.golang.org/protobuf/proto.equalField(fd FieldDescriptor, x, y Value) bool
func google.golang.org/protobuf/proto.equalList(fd FieldDescriptor, x, y List) bool
func google.golang.org/protobuf/proto.equalMap(fd FieldDescriptor, x, y Map) bool
func google.golang.org/protobuf/proto.equalValue(fd FieldDescriptor, x, y Value) bool
func google.golang.org/protobuf/proto.MarshalOptions.marshalField(b []byte, fd FieldDescriptor, value Value) ([]byte, error)
func google.golang.org/protobuf/proto.MarshalOptions.marshalList(b []byte, fd FieldDescriptor, list List) ([]byte, error)
func google.golang.org/protobuf/proto.MarshalOptions.marshalMap(b []byte, fd FieldDescriptor, mapv Map) ([]byte, error)
func google.golang.org/protobuf/proto.MarshalOptions.marshalMessageSetField(b []byte, fd FieldDescriptor, value Value) ([]byte, error)
func google.golang.org/protobuf/proto.MarshalOptions.marshalSingular(b []byte, fd FieldDescriptor, v Value) ([]byte, error)
func google.golang.org/protobuf/proto.MarshalOptions.sizeField(fd FieldDescriptor, value Value) (size int)
func google.golang.org/protobuf/proto.MarshalOptions.sizeList(num protowire.Number, fd FieldDescriptor, list List) (size int)
func google.golang.org/protobuf/proto.MarshalOptions.sizeMap(num protowire.Number, fd FieldDescriptor, mapv Map) (size int)
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalList(b []byte, wtyp protowire.Type, list List, fd FieldDescriptor) (n int, err error)
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalMap(b []byte, wtyp protowire.Type, mapv Map, fd FieldDescriptor) (n int, err error)
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalScalar(b []byte, wtyp protowire.Type, fd FieldDescriptor) (val Value, n int, err error)
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalSingular(b []byte, wtyp protowire.Type, m Message, fd FieldDescriptor) (n int, err error)
func github.com/golang/protobuf/proto.goTypeForField(fd FieldDescriptor) reflect.Type
FieldDescriptors is a list of field declarations.
ByJSONName returns the FieldDescriptor for a field with s as the JSON name.
It returns nil if not found.
ByName returns the FieldDescriptor for a field named s.
It returns nil if not found.
ByNumber returns the FieldDescriptor for a field numbered n.
It returns nil if not found.
ByTextName returns the FieldDescriptor for a field with s as the text name.
It returns nil if not found.
Get returns the ith FieldDescriptor. It panics if out of bounds.
Len reports the number of fields.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.Fields
*google.golang.org/protobuf/internal/filedesc.OneofFields
T : ExtensionDescriptors
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func MessageDescriptor.Fields() FieldDescriptors
func OneofDescriptor.Fields() FieldDescriptors
func google.golang.org/protobuf/internal/filedesc.(*Message).Fields() FieldDescriptors
func google.golang.org/protobuf/internal/filedesc.(*Oneof).Fields() FieldDescriptors
func google.golang.org/protobuf/internal/filedesc.PlaceholderMessage.Fields() FieldDescriptors
FieldNumber is the field number in a message.
FieldNumbers represent a list of field numbers.
Get returns the ith field number. It panics if out of bounds.
Has reports whether n is within the list of fields.
Len reports the number of fields in the list.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.FieldNumbers
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func MessageDescriptor.RequiredNumbers() FieldNumbers
func google.golang.org/protobuf/internal/filedesc.(*Message).RequiredNumbers() FieldNumbers
func google.golang.org/protobuf/internal/filedesc.PlaceholderMessage.RequiredNumbers() FieldNumbers
FileDescriptor describes the types in a complete proto file and
corresponds with the google.protobuf.FileDescriptorProto message.
Top-level declarations:
EnumDescriptor, MessageDescriptor, FieldDescriptor, and/or ServiceDescriptor.
Enums is a list of the top-level enum declarations.
Extensions is a list of the top-level extension declarations.
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
Imports is a list of imported proto files.
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
Messages is a list of the top-level message declarations.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Package returns the protobuf package namespace.
// e.g., "google.protobuf"
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
Path returns the file name, relative to the source tree root.
// e.g., "path/to/file.proto"
( T) ProtoInternal(pragma.DoNotImplement)( T) ProtoType(FileDescriptor)
Services is a list of the top-level service declarations.
SourceLocations is a list of source locations.
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
FileImport
*google.golang.org/protobuf/internal/filedesc.File
google.golang.org/protobuf/internal/filedesc.PlaceholderFile
T : Descriptor
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : isFileDescriptor
func Descriptor.ParentFile() FileDescriptor
func EnumDescriptor.ParentFile() FileDescriptor
func EnumValueDescriptor.ParentFile() FileDescriptor
func ExtensionDescriptor.ParentFile() FileDescriptor
func ExtensionTypeDescriptor.ParentFile() FileDescriptor
func FieldDescriptor.ParentFile() FileDescriptor
func FileDescriptor.ParentFile() FileDescriptor
func MessageDescriptor.ParentFile() FileDescriptor
func MethodDescriptor.ParentFile() FileDescriptor
func OneofDescriptor.ParentFile() FileDescriptor
func ServiceDescriptor.ParentFile() FileDescriptor
func google.golang.org/protobuf/reflect/protodesc.NewFile(fd *descriptorpb.FileDescriptorProto, r protodesc.Resolver) (FileDescriptor, error)
func google.golang.org/protobuf/reflect/protodesc.FileOptions.New(fd *descriptorpb.FileDescriptorProto, r protodesc.Resolver) (FileDescriptor, error)
func google.golang.org/protobuf/reflect/protodesc.Resolver.FindFileByPath(string) (FileDescriptor, error)
func google.golang.org/protobuf/reflect/protoregistry.(*Files).FindFileByPath(path string) (FileDescriptor, error)
func google.golang.org/protobuf/internal/filedesc.(*Base).ParentFile() FileDescriptor
func google.golang.org/protobuf/internal/filedesc.(*File).ParentFile() FileDescriptor
func google.golang.org/protobuf/internal/filedesc.PlaceholderEnum.ParentFile() FileDescriptor
func google.golang.org/protobuf/internal/filedesc.PlaceholderEnumValue.ParentFile() FileDescriptor
func google.golang.org/protobuf/internal/filedesc.PlaceholderFile.ParentFile() FileDescriptor
func google.golang.org/protobuf/internal/filedesc.PlaceholderMessage.ParentFile() FileDescriptor
func google.golang.org/protobuf/internal/impl.legacyLoadFileDesc(b []byte) FileDescriptor
func FileDescriptor.ProtoType(FileDescriptor)
func google.golang.org/protobuf/reflect/protodesc.ToFileDescriptorProto(file FileDescriptor) *descriptorpb.FileDescriptorProto
func google.golang.org/protobuf/reflect/protoregistry.(*Files).RegisterFile(file FileDescriptor) error
func google.golang.org/protobuf/internal/filedesc.(*File).ProtoType(FileDescriptor)
func google.golang.org/protobuf/internal/filedesc.PlaceholderFile.ProtoType(FileDescriptor)
func google.golang.org/protobuf/reflect/protoregistry.rangeTopLevelDescriptors(fd FileDescriptor, f func(Descriptor))
var google.golang.org/protobuf/types/descriptorpb.File_google_protobuf_descriptor_proto
var google.golang.org/protobuf/types/known/anypb.File_google_protobuf_any_proto
var google.golang.org/protobuf/types/known/durationpb.File_google_protobuf_duration_proto
var google.golang.org/protobuf/types/known/timestamppb.File_google_protobuf_timestamp_proto
var google.golang.org/genproto/googleapis/api/annotations.File_google_api_annotations_proto
var google.golang.org/genproto/googleapis/api/annotations.File_google_api_client_proto
var google.golang.org/genproto/googleapis/api/annotations.File_google_api_field_behavior_proto
var google.golang.org/genproto/googleapis/api/annotations.File_google_api_http_proto
var google.golang.org/genproto/googleapis/api/annotations.File_google_api_resource_proto
var google.golang.org/genproto/googleapis/logging/type.File_google_logging_type_http_request_proto
var google.golang.org/genproto/googleapis/logging/type.File_google_logging_type_log_severity_proto
var github.com/golang/protobuf/ptypes/any.File_github_com_golang_protobuf_ptypes_any_any_proto
var github.com/golang/protobuf/ptypes/duration.File_github_com_golang_protobuf_ptypes_duration_duration_proto
var github.com/golang/protobuf/ptypes/timestamp.File_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto
FileImport is the declaration for a proto file import.
FileDescriptor is the file type for the given import.
It is a placeholder descriptor if IsWeak is set or if a dependency has
not been regenerated to implement the new reflection APIs.
IsPublic reports whether this is a public import, which causes this file
to alias declarations within the imported file. The intended use cases
for this feature is the ability to move proto files without breaking
existing dependencies.
The current file and the imported file must be within proto package.
IsWeak reports whether this is a weak import, which does not impose
a direct dependency on the target file.
Weak imports are a legacy proto1 feature. Equivalent behavior is
achieved using proto2 extension fields or proto3 Any messages.
Enums is a list of the top-level enum declarations.
Extensions is a list of the top-level extension declarations.
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
Imports is a list of imported proto files.
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
Messages is a list of the top-level message declarations.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Package returns the protobuf package namespace.
// e.g., "google.protobuf"
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
Path returns the file name, relative to the source tree root.
// e.g., "path/to/file.proto"
( T) ProtoInternal(pragma.DoNotImplement)( T) ProtoType(FileDescriptor)
Services is a list of the top-level service declarations.
SourceLocations is a list of source locations.
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
T : Descriptor
T : FileDescriptor
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : isFileDescriptor
func FileImports.Get(i int) FileImport
func google.golang.org/protobuf/internal/filedesc.(*FileImports).Get(i int) FileImport
FileImports is a list of file imports.
Get returns the ith FileImport. It panics if out of bounds.
Len reports the number of files imported by this proto file.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.FileImports
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func FileDescriptor.Imports() FileImports
func google.golang.org/protobuf/internal/filedesc.(*File).Imports() FileImports
func google.golang.org/protobuf/internal/filedesc.PlaceholderFile.Imports() FileImports
List is a zero-indexed, ordered list.
The element Value type is determined by FieldDescriptor.Kind.
Providing a Value that is invalid or of an incorrect type panics.
Append appends the provided value to the end of the list.
When appending a composite type, it is unspecified whether the appended
value aliases the source's memory in any way.
Append is a mutating operation and unsafe for concurrent use.
AppendMutable appends a new, empty, mutable message value to the end
of the list and returns it.
It panics if the list does not contain a message type.
Get retrieves the value at the given index.
It never returns an invalid value.
IsValid reports whether the list is valid.
An invalid list is an empty, read-only value.
Validity is not part of the protobuf data model, and may not
be preserved in marshaling or other operations.
Len reports the number of entries in the List.
Get, Set, and Truncate panic with out of bound indexes.
NewElement returns a new value for a list element.
For enums, this returns the first enum value.
For other scalars, this returns the zero value.
For messages, this returns a new, empty, mutable value.
Set stores a value for the given index.
When setting a composite type, it is unspecified whether the set
value aliases the source's memory in any way.
Set is a mutating operation and unsafe for concurrent use.
Truncate truncates the list to a smaller length.
Truncate is a mutating operation and unsafe for concurrent use.
*google.golang.org/protobuf/internal/impl.listReflect
func Value.List() List
func ValueOfList(v List) Value
func google.golang.org/protobuf/proto.equalList(fd FieldDescriptor, x, y List) bool
func google.golang.org/protobuf/proto.MarshalOptions.marshalList(b []byte, fd FieldDescriptor, list List) ([]byte, error)
func google.golang.org/protobuf/proto.MarshalOptions.sizeList(num protowire.Number, fd FieldDescriptor, list List) (size int)
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalList(b []byte, wtyp protowire.Type, list List, fd FieldDescriptor) (n int, err error)
Map is an unordered, associative map.
The entry MapKey type is determined by FieldDescriptor.MapKey.Kind.
The entry Value type is determined by FieldDescriptor.MapValue.Kind.
Providing a MapKey or Value that is invalid or of an incorrect type panics.
Clear clears the entry associated with they given key.
The operation does nothing if there is no entry associated with the key.
Clear is a mutating operation and unsafe for concurrent use.
Get retrieves the value for an entry with the given key.
It returns an invalid value for non-existent entries.
Has reports whether an entry with the given key is in the map.
IsValid reports whether the map is valid.
An invalid map is an empty, read-only value.
An invalid message often corresponds to a nil Go map value,
but the details are implementation dependent.
Validity is not part of the protobuf data model, and may not
be preserved in marshaling or other operations.
Len reports the number of elements in the map.
Mutable retrieves a mutable reference to the entry for the given key.
If no entry exists for the key, it creates a new, empty, mutable value
and stores it as the entry for the key.
It panics if the map value is not a message.
NewValue returns a new value assignable as a map value.
For enums, this returns the first enum value.
For other scalars, this returns the zero value.
For messages, this returns a new, empty, mutable value.
Range iterates over every map entry in an undefined order,
calling f for each key and value encountered.
Range calls f Len times unless f returns false, which stops iteration.
While iterating, mutating operations may only be performed
on the current map key.
Set stores the value for an entry with the given key.
It panics when given a key or value that is invalid or the wrong type.
When setting a composite type, it is unspecified whether the set
value aliases the source's memory in any way.
Set is a mutating operation and unsafe for concurrent use.
*google.golang.org/protobuf/internal/impl.mapReflect
T : google.golang.org/protobuf/internal/order.EntryRanger
func Value.Map() Map
func ValueOfMap(v Map) Value
func google.golang.org/protobuf/proto.equalMap(fd FieldDescriptor, x, y Map) bool
func google.golang.org/protobuf/proto.MarshalOptions.marshalMap(b []byte, fd FieldDescriptor, mapv Map) ([]byte, error)
func google.golang.org/protobuf/proto.MarshalOptions.sizeMap(num protowire.Number, fd FieldDescriptor, mapv Map) (size int)
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalMap(b []byte, wtyp protowire.Type, mapv Map, fd FieldDescriptor) (n int, err error)
MapKey is used to index maps, where the Go type of the MapKey must match
the specified key Kind (see MessageDescriptor.IsMapEntry).
The following shows what Go type is used to represent each proto Kind:
╔═════════╤═════════════════════════════════════╗
║ Go type │ Protobuf kind ║
╠═════════╪═════════════════════════════════════╣
║ bool │ BoolKind ║
║ int32 │ Int32Kind, Sint32Kind, Sfixed32Kind ║
║ int64 │ Int64Kind, Sint64Kind, Sfixed64Kind ║
║ uint32 │ Uint32Kind, Fixed32Kind ║
║ uint64 │ Uint64Kind, Fixed64Kind ║
║ string │ StringKind ║
╚═════════╧═════════════════════════════════════╝
A MapKey is constructed and accessed through a Value:
k := ValueOf("hash").MapKey() // convert string to MapKey
s := k.String() // convert MapKey to string
The MapKey is a strict subset of valid types used in Value;
converting a Value to a MapKey with an invalid type panics.
// 0B
num stores a Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, or
Enum value as a raw uint64.
It is also used to store the length of a String or Bytes value;
the capacity is ignored.
// 8B
ptr stores the data pointer for a String, Bytes, or interface value.
// 8B
typ stores the type of the value as a pointer to the Go type.
// 8B
Bool returns k as a bool and panics if the type is not a bool.
Int returns k as a int64 and panics if the type is not a int32 or int64.
Interface returns k as an interface{}.
IsValid reports whether k is populated with a value.
String returns k as a string. Since this method implements fmt.Stringer,
this returns the formatted string value for any non-string type.
Uint returns k as a uint64 and panics if the type is not a uint32 or uint64.
Value returns k as a Value.
T : fmt.Stringer
T : context.stringer
T : os/signal.stringer
T : runtime.stringer
func Value.MapKey() MapKey
func Map.Clear(MapKey)
func Map.Get(MapKey) Value
func Map.Has(MapKey) bool
func Map.Mutable(MapKey) Value
func Map.Set(MapKey, Value)
Message is a reflective interface for a concrete message value,
encapsulating both type and value information for the message.
Accessor/mutators for individual fields are keyed by FieldDescriptor.
For non-extension fields, the descriptor must exactly match the
field known by the parent message.
For extension fields, the descriptor must implement ExtensionTypeDescriptor,
extend the parent message (i.e., have the same message FullName), and
be within the parent's extension range.
Each field Value can be a scalar or a composite type (Message, List, or Map).
See Value for the Go types associated with a FieldDescriptor.
Providing a Value that is invalid or of an incorrect type panics.
Clear clears the field such that a subsequent Has call reports false.
Clearing an extension field clears both the extension type and value
associated with the given field number.
Clear is a mutating operation and unsafe for concurrent use.
Descriptor returns message descriptor, which contains only the protobuf
type information for the message.
Get retrieves the value for a field.
For unpopulated scalars, it returns the default value, where
the default value of a bytes scalar is guaranteed to be a copy.
For unpopulated composite types, it returns an empty, read-only view
of the value; to obtain a mutable reference, use Mutable.
GetUnknown retrieves the entire list of unknown fields.
The caller may only mutate the contents of the RawFields
if the mutated bytes are stored back into the message with SetUnknown.
Has reports whether a field is populated.
Some fields have the property of nullability where it is possible to
distinguish between the default value of a field and whether the field
was explicitly populated with the default value. Singular message fields,
member fields of a oneof, and proto2 scalar fields are nullable. Such
fields are populated only if explicitly set.
In other cases (aside from the nullable cases above),
a proto3 scalar field is populated if it contains a non-zero value, and
a repeated field is populated if it is non-empty.
Interface unwraps the message reflection interface and
returns the underlying ProtoMessage interface.
IsValid reports whether the message is valid.
An invalid message is an empty, read-only value.
An invalid message often corresponds to a nil pointer of the concrete
message type, but the details are implementation dependent.
Validity is not part of the protobuf data model, and may not
be preserved in marshaling or other operations.
Mutable returns a mutable reference to a composite type.
If the field is unpopulated, it may allocate a composite value.
For a field belonging to a oneof, it implicitly clears any other field
that may be currently set within the same oneof.
For extension fields, it implicitly stores the provided ExtensionType
if not already stored.
It panics if the field does not contain a composite type.
Mutable is a mutating operation and unsafe for concurrent use.
New returns a newly allocated and mutable empty message.
NewField returns a new value that is assignable to the field
for the given descriptor. For scalars, this returns the default value.
For lists, maps, and messages, this returns a new, empty, mutable value.
ProtoMethods returns optional fast-path implementions of various operations.
This method may return nil.
The returned methods type is identical to
"google.golang.org/protobuf/runtime/protoiface".Methods.
Consult the protoiface package documentation for details.
Range iterates over every populated field in an undefined order,
calling f for each field descriptor and value encountered.
Range returns immediately if f returns false.
While iterating, mutating operations may only be performed
on the current field descriptor.
Set stores the value for a field.
For a field belonging to a oneof, it implicitly clears any other field
that may be currently set within the same oneof.
For extension fields, it implicitly stores the provided ExtensionType.
When setting a composite type, it is unspecified whether the stored value
aliases the source's memory in any way. If the composite value is an
empty, read-only value, then it panics.
Set is a mutating operation and unsafe for concurrent use.
SetUnknown stores an entire list of unknown fields.
The raw fields must be syntactically valid according to the wire format.
An implementation may panic if this is not the case.
Once stored, the caller must not mutate the content of the RawFields.
An empty RawFields may be passed to clear the fields.
SetUnknown is a mutating operation and unsafe for concurrent use.
Type returns the message type, which encapsulates both Go and protobuf
type information. If the Go type information is not needed,
it is recommended that the message descriptor be used instead.
WhichOneof reports which field within the oneof is populated,
returning nil if none are populated.
It panics if the oneof descriptor does not belong to this message.
google.golang.org/protobuf/internal/impl.aberrantMessage
*google.golang.org/protobuf/internal/impl.messageReflectWrapper
*google.golang.org/protobuf/internal/impl.messageState
github.com/golang/protobuf/ptypes.dynamicAny
T : google.golang.org/protobuf/internal/order.FieldRanger
func Message.New() Message
func MessageFieldTypes.New() Message
func MessageFieldTypes.Zero() Message
func MessageType.New() Message
func MessageType.Zero() Message
func ProtoMessage.ProtoReflect() Message
func Value.Message() Message
func google.golang.org/protobuf/internal/impl.Export.MessageOf(m impl.message) Message
func google.golang.org/protobuf/internal/impl.(*MessageInfo).MessageOf(m interface{}) Message
func google.golang.org/protobuf/internal/impl.(*MessageInfo).New() Message
func google.golang.org/protobuf/internal/impl.(*MessageInfo).Zero() Message
func google.golang.org/protobuf/proto.Message.ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*DescriptorProto).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*DescriptorProto_ExtensionRange).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*DescriptorProto_ReservedRange).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*EnumDescriptorProto).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*EnumDescriptorProto_EnumReservedRange).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*EnumOptions).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*EnumValueDescriptorProto).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*EnumValueOptions).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*ExtensionRangeOptions).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*FieldDescriptorProto).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*FieldOptions).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*FileDescriptorProto).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*FileDescriptorSet).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*FileOptions).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*GeneratedCodeInfo).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*GeneratedCodeInfo_Annotation).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*MessageOptions).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*MethodDescriptorProto).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*MethodOptions).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*OneofDescriptorProto).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*OneofOptions).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*ServiceDescriptorProto).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*ServiceOptions).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*SourceCodeInfo).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*SourceCodeInfo_Location).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*UninterpretedOption).ProtoReflect() Message
func google.golang.org/protobuf/types/descriptorpb.(*UninterpretedOption_NamePart).ProtoReflect() Message
func google.golang.org/protobuf/types/known/anypb.(*Any).ProtoReflect() Message
func google.golang.org/protobuf/types/known/durationpb.(*Duration).ProtoReflect() Message
func google.golang.org/protobuf/types/known/timestamppb.(*Timestamp).ProtoReflect() Message
func google.golang.org/genproto/googleapis/api/annotations.(*CustomHttpPattern).ProtoReflect() Message
func google.golang.org/genproto/googleapis/api/annotations.(*Http).ProtoReflect() Message
func google.golang.org/genproto/googleapis/api/annotations.(*HttpRule).ProtoReflect() Message
func google.golang.org/genproto/googleapis/api/annotations.(*ResourceDescriptor).ProtoReflect() Message
func google.golang.org/genproto/googleapis/api/annotations.(*ResourceReference).ProtoReflect() Message
func google.golang.org/genproto/googleapis/logging/type.(*HttpRequest).ProtoReflect() Message
func github.com/golang/protobuf/proto.MessageReflect(m proto.Message) Message
func github.com/golang/protobuf/ptypes.DynamicAny.ProtoReflect() Message
func google.golang.org/protobuf/internal/impl.legacyWrapMessage(v reflect.Value) Message
func ValueOfMessage(v Message) Value
func google.golang.org/protobuf/internal/impl.IsLazy(m Message, fd FieldDescriptor) bool
func google.golang.org/protobuf/internal/impl.(*MessageInfo).getPointer(m Message) (p impl.pointer, ok bool)
func google.golang.org/protobuf/proto.checkInitialized(m Message) error
func google.golang.org/protobuf/proto.checkInitializedSlow(m Message) error
func google.golang.org/protobuf/proto.equalMessage(mx, my Message) bool
func google.golang.org/protobuf/proto.protoMethods(m Message) *protoiface.Methods
func google.golang.org/protobuf/proto.resetMessage(m Message)
func google.golang.org/protobuf/proto.MarshalOptions.marshal(b []byte, m Message) (out protoiface.MarshalOutput, err error)
func google.golang.org/protobuf/proto.MarshalOptions.marshalMessage(b []byte, m Message) ([]byte, error)
func google.golang.org/protobuf/proto.MarshalOptions.marshalMessageSet(b []byte, m Message) ([]byte, error)
func google.golang.org/protobuf/proto.MarshalOptions.marshalMessageSlow(b []byte, m Message) ([]byte, error)
func google.golang.org/protobuf/proto.MarshalOptions.size(m Message) (size int)
func google.golang.org/protobuf/proto.MarshalOptions.sizeMessageSet(m Message) (size int)
func google.golang.org/protobuf/proto.MarshalOptions.sizeMessageSlow(m Message) (size int)
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshal(b []byte, m Message) (out protoiface.UnmarshalOutput, err error)
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalMessage(b []byte, m Message) error
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalMessageSet(b []byte, m Message) error
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalMessageSetField(m Message, num protowire.Number, v []byte) error
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalMessageSlow(b []byte, m Message) error
func google.golang.org/protobuf/proto.UnmarshalOptions.unmarshalSingular(b []byte, wtyp protowire.Type, m Message, fd FieldDescriptor) (n int, err error)
func github.com/golang/protobuf/proto.clearUnknown(m Message, remover interface{Has(FieldNumber) bool})
func github.com/golang/protobuf/proto.discardUnknown(m Message)
func github.com/golang/protobuf/proto.setDefaults(m Message)
MessageDescriptor describes a message and
corresponds with the google.protobuf.DescriptorProto message.
Nested declarations:
FieldDescriptor, OneofDescriptor, FieldDescriptor, EnumDescriptor,
and/or MessageDescriptor.
Enums is a list of nested enum declarations.
ExtensionRangeOptions returns the ith extension range options.
To avoid a dependency cycle, this method returns a proto.Message value,
which always contains a google.protobuf.ExtensionRangeOptions message.
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
ExtensionRanges is the field ranges used for extension fields.
In Proto3, it is always an empty ranges.
Extensions is a list of nested extension declarations.
Fields is a list of nested field declarations.
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
IsMapEntry indicates that this is an auto-generated message type to
represent the entry type for a map field.
Map entry messages have only two fields:
• a "key" field with a field number of 1
• a "value" field with a field number of 2
The key and value types are determined by these two fields.
If IsMapEntry is true, it implies that FieldDescriptor.IsMap is true
for some field with this message type.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
Messages is a list of nested message declarations.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Oneofs is a list of nested oneof declarations.
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
( T) ProtoInternal(pragma.DoNotImplement)( T) ProtoType(MessageDescriptor)
RequiredNumbers is a list of required field numbers.
In Proto3, it is always an empty list.
ReservedNames is a list of reserved field names.
ReservedRanges is a list of reserved ranges of field numbers.
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
*google.golang.org/protobuf/internal/filedesc.Message
google.golang.org/protobuf/internal/filedesc.PlaceholderMessage
T : Descriptor
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : isMessageDescriptor
func ExtensionDescriptor.ContainingMessage() MessageDescriptor
func ExtensionDescriptor.Message() MessageDescriptor
func ExtensionTypeDescriptor.ContainingMessage() MessageDescriptor
func ExtensionTypeDescriptor.Message() MessageDescriptor
func FieldDescriptor.ContainingMessage() MessageDescriptor
func FieldDescriptor.Message() MessageDescriptor
func Message.Descriptor() MessageDescriptor
func MessageDescriptors.ByName(s Name) MessageDescriptor
func MessageDescriptors.Get(i int) MessageDescriptor
func MessageFieldTypes.Descriptor() MessageDescriptor
func MessageType.Descriptor() MessageDescriptor
func MethodDescriptor.Input() MessageDescriptor
func MethodDescriptor.Output() MessageDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Extension).ContainingMessage() MessageDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Extension).Message() MessageDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Field).ContainingMessage() MessageDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Field).Message() MessageDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Messages).ByName(s Name) MessageDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Messages).Get(i int) MessageDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Method).Input() MessageDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Method).Output() MessageDescriptor
func google.golang.org/protobuf/internal/impl.LegacyLoadMessageDesc(t reflect.Type) MessageDescriptor
func google.golang.org/protobuf/internal/impl.Export.MessageDescriptorOf(m impl.message) MessageDescriptor
func google.golang.org/protobuf/internal/impl.(*MessageInfo).Descriptor() MessageDescriptor
func google.golang.org/protobuf/internal/filedesc.(*File).resolveMessageDependency(md MessageDescriptor, i, j int32) MessageDescriptor
func google.golang.org/protobuf/internal/impl.aberrantLoadMessageDesc(t reflect.Type, name FullName) MessageDescriptor
func google.golang.org/protobuf/internal/impl.aberrantLoadMessageDescReentrant(t reflect.Type, name FullName) MessageDescriptor
func google.golang.org/protobuf/internal/impl.legacyLoadMessageDesc(t reflect.Type, name FullName) MessageDescriptor
func MessageDescriptor.ProtoType(MessageDescriptor)
func google.golang.org/protobuf/reflect/protodesc.ToDescriptorProto(message MessageDescriptor) *descriptorpb.DescriptorProto
func google.golang.org/protobuf/internal/encoding/messageset.IsMessageSet(md MessageDescriptor) bool
func google.golang.org/protobuf/internal/filedesc.(*Message).ProtoType(MessageDescriptor)
func google.golang.org/protobuf/internal/filedesc.PlaceholderMessage.ProtoType(MessageDescriptor)
func google.golang.org/protobuf/reflect/protoregistry.findDescriptorInMessage(md MessageDescriptor, suffix protoregistry.nameSuffix) Descriptor
func google.golang.org/protobuf/internal/filedesc.(*File).resolveMessageDependency(md MessageDescriptor, i, j int32) MessageDescriptor
func google.golang.org/protobuf/internal/impl.needsInitCheck(md MessageDescriptor) bool
func google.golang.org/protobuf/internal/impl.needsInitCheckLocked(md MessageDescriptor) (has bool)
func github.com/golang/protobuf/proto.isMessageSet(md MessageDescriptor) bool
func github.com/golang/protobuf/proto.isValidExtension(md MessageDescriptor, xtd ExtensionTypeDescriptor) bool
MessageDescriptors is a list of message declarations.
ByName returns the MessageDescriptor for a message named s.
It returns nil if not found.
Get returns the ith MessageDescriptor. It panics if out of bounds.
Len reports the number of messages.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.Messages
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func FileDescriptor.Messages() MessageDescriptors
func MessageDescriptor.Messages() MessageDescriptors
func google.golang.org/protobuf/internal/filedesc.(*File).Messages() MessageDescriptors
func google.golang.org/protobuf/internal/filedesc.(*Message).Messages() MessageDescriptors
func google.golang.org/protobuf/internal/filedesc.PlaceholderFile.Messages() MessageDescriptors
func google.golang.org/protobuf/internal/filedesc.PlaceholderMessage.Messages() MessageDescriptors
MessageFieldTypes extends a MessageType by providing type information
regarding enums and messages referenced by the message fields.
Descriptor returns the message descriptor.
Invariant: t.Descriptor() == t.New().Descriptor()
Enum returns the EnumType for the ith field in Descriptor.Fields.
It returns nil if the ith field is not an enum kind.
It panics if out of bounds.
Invariant: mt.Enum(i).Descriptor() == mt.Descriptor().Fields(i).Enum()
Message returns the MessageType for the ith field in Descriptor.Fields.
It returns nil if the ith field is not a message or group kind.
It panics if out of bounds.
Invariant: mt.Message(i).Descriptor() == mt.Descriptor().Fields(i).Message()
New returns a newly allocated empty message.
It may return nil for synthetic messages representing a map entry.
Zero returns an empty, read-only message.
It may return nil for synthetic messages representing a map entry.
*google.golang.org/protobuf/internal/impl.MessageInfo
google.golang.org/protobuf/internal/impl.mapEntryType
T : MessageType
MethodDescriptor describes a method and
corresponds with the google.protobuf.MethodDescriptorProto message.
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
Input is the input message descriptor.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
IsStreamingClient reports whether the client streams multiple messages.
IsStreamingServer reports whether the server streams multiple messages.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Output is the output message descriptor.
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
( T) ProtoInternal(pragma.DoNotImplement)( T) ProtoType(MethodDescriptor)
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
*google.golang.org/protobuf/internal/filedesc.Method
T : Descriptor
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : isMethodDescriptor
func MethodDescriptors.ByName(s Name) MethodDescriptor
func MethodDescriptors.Get(i int) MethodDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Methods).ByName(s Name) MethodDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Methods).Get(i int) MethodDescriptor
func MethodDescriptor.ProtoType(MethodDescriptor)
func google.golang.org/protobuf/reflect/protodesc.ToMethodDescriptorProto(method MethodDescriptor) *descriptorpb.MethodDescriptorProto
func google.golang.org/protobuf/internal/filedesc.(*Method).ProtoType(MethodDescriptor)
MethodDescriptors is a list of method declarations.
ByName returns the MethodDescriptor for a service method named s.
It returns nil if not found.
Get returns the ith MethodDescriptor. It panics if out of bounds.
Len reports the number of methods.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.Methods
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func ServiceDescriptor.Methods() MethodDescriptors
func google.golang.org/protobuf/internal/filedesc.(*Service).Methods() MethodDescriptors
OneofDescriptor describes a oneof field set within a given message and
corresponds with the google.protobuf.OneofDescriptorProto message.
Fields is a list of fields belonging to this oneof.
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
IsSynthetic reports whether this is a synthetic oneof created to support
proto3 optional semantics. If true, Fields contains exactly one field
with HasOptionalKeyword specified.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
( T) ProtoInternal(pragma.DoNotImplement)( T) ProtoType(OneofDescriptor)
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
*google.golang.org/protobuf/internal/filedesc.Oneof
T : Descriptor
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : isOneofDescriptor
func ExtensionDescriptor.ContainingOneof() OneofDescriptor
func ExtensionTypeDescriptor.ContainingOneof() OneofDescriptor
func FieldDescriptor.ContainingOneof() OneofDescriptor
func OneofDescriptors.ByName(s Name) OneofDescriptor
func OneofDescriptors.Get(i int) OneofDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Extension).ContainingOneof() OneofDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Field).ContainingOneof() OneofDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Oneofs).ByName(s Name) OneofDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Oneofs).Get(i int) OneofDescriptor
func Message.WhichOneof(OneofDescriptor) FieldDescriptor
func OneofDescriptor.ProtoType(OneofDescriptor)
func google.golang.org/protobuf/reflect/protodesc.ToOneofDescriptorProto(oneof OneofDescriptor) *descriptorpb.OneofDescriptorProto
func google.golang.org/protobuf/internal/filedesc.(*Oneof).ProtoType(OneofDescriptor)
func google.golang.org/protobuf/internal/impl.makeOneofInfo(od OneofDescriptor, si impl.structInfo, x impl.exporter) *impl.oneofInfo
func google.golang.org/protobuf/internal/impl.(*MessageInfo).initOneofFieldCoders(od OneofDescriptor, si impl.structInfo)
OneofDescriptors is a list of oneof declarations.
ByName returns the OneofDescriptor for a oneof named s.
It returns nil if not found.
Get returns the ith OneofDescriptor. It panics if out of bounds.
Len reports the number of oneof fields.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.Oneofs
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func MessageDescriptor.Oneofs() OneofDescriptors
func google.golang.org/protobuf/internal/filedesc.(*Message).Oneofs() OneofDescriptors
func google.golang.org/protobuf/internal/filedesc.PlaceholderMessage.Oneofs() OneofDescriptors
RawFields is the raw bytes for an ordered sequence of fields.
Each field contains both the tag (representing field number and wire type),
and also the wire data itself.
IsValid reports whether b is syntactically correct wire format.
func Message.GetUnknown() RawFields
func Message.SetUnknown(RawFields)
func google.golang.org/protobuf/proto.equalUnknown(x, y RawFields) bool
ServiceDescriptor describes a service and
corresponds with the google.protobuf.ServiceDescriptorProto message.
Nested declarations: MethodDescriptor.
FullName is the fully-qualified name of the declaration.
The FullName is a concatenation of the full name of the type that this
type is declared within and the declaration name. For example,
field "foo_field" in message "proto.package.MyMessage" is
uniquely identified as "proto.package.MyMessage.foo_field".
Enum values are an exception to the rule (see EnumValueDescriptor).
// e.g., "google.protobuf.Any"
Index returns the index of this descriptor within its parent.
It returns 0 if the descriptor does not have a parent or if the parent
is unknown.
IsPlaceholder reports whether type information is missing since a
dependency is not resolved, in which case only name information is known.
Placeholder types may only be returned by the following accessors
as a result of unresolved dependencies or weak imports:
╔═══════════════════════════════════╤═════════════════════╗
║ Accessor │ Descriptor ║
╠═══════════════════════════════════╪═════════════════════╣
║ FileImports.FileDescriptor │ FileDescriptor ║
║ FieldDescriptor.Enum │ EnumDescriptor ║
║ FieldDescriptor.Message │ MessageDescriptor ║
║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
║ MethodDescriptor.Input │ MessageDescriptor ║
║ MethodDescriptor.Output │ MessageDescriptor ║
╚═══════════════════════════════════╧═════════════════════╝
If true, only Name and FullName are valid.
For FileDescriptor, the Path is also valid.
Methods is a list of nested message declarations.
Name is the short name of the declaration (i.e., FullName.Name).
// e.g., "Any"
Options returns the descriptor options. The caller must not modify
the returned value.
To avoid a dependency cycle, this function returns a proto.Message value.
The proto message type returned for each descriptor type is as follows:
╔═════════════════════╤══════════════════════════════════════════╗
║ Go type │ Protobuf message type ║
╠═════════════════════╪══════════════════════════════════════════╣
║ FileDescriptor │ google.protobuf.FileOptions ║
║ EnumDescriptor │ google.protobuf.EnumOptions ║
║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
║ MessageDescriptor │ google.protobuf.MessageOptions ║
║ FieldDescriptor │ google.protobuf.FieldOptions ║
║ OneofDescriptor │ google.protobuf.OneofOptions ║
║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
║ MethodDescriptor │ google.protobuf.MethodOptions ║
╚═════════════════════╧══════════════════════════════════════════╝
This method returns a typed nil-pointer if no options are present.
The caller must import the descriptorpb package to use this.
Parent returns the parent containing this descriptor declaration.
The following shows the mapping from child type to possible parent types:
╔═════════════════════╤═══════════════════════════════════╗
║ Child type │ Possible parent types ║
╠═════════════════════╪═══════════════════════════════════╣
║ FileDescriptor │ nil ║
║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
║ OneofDescriptor │ MessageDescriptor ║
║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
║ EnumValueDescriptor │ EnumDescriptor ║
║ ServiceDescriptor │ FileDescriptor ║
║ MethodDescriptor │ ServiceDescriptor ║
╚═════════════════════╧═══════════════════════════════════╝
Support for this functionality is optional and may return nil.
ParentFile returns the parent file descriptor that this descriptor
is declared within. The parent file for the file descriptor is itself.
Support for this functionality is optional and may return nil.
( T) ProtoInternal(pragma.DoNotImplement)( T) ProtoType(ServiceDescriptor)
Syntax is the protobuf syntax.
// e.g., Proto2 or Proto3
*google.golang.org/protobuf/internal/filedesc.Service
T : Descriptor
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : isServiceDescriptor
func ServiceDescriptors.ByName(s Name) ServiceDescriptor
func ServiceDescriptors.Get(i int) ServiceDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Services).ByName(s Name) ServiceDescriptor
func google.golang.org/protobuf/internal/filedesc.(*Services).Get(i int) ServiceDescriptor
func ServiceDescriptor.ProtoType(ServiceDescriptor)
func google.golang.org/protobuf/reflect/protodesc.ToServiceDescriptorProto(service ServiceDescriptor) *descriptorpb.ServiceDescriptorProto
func google.golang.org/protobuf/internal/filedesc.(*Service).ProtoType(ServiceDescriptor)
ServiceDescriptors is a list of service declarations.
ByName returns the ServiceDescriptor for a service named s.
It returns nil if not found.
Get returns the ith ServiceDescriptor. It panics if out of bounds.
Len reports the number of services.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.Services
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func FileDescriptor.Services() ServiceDescriptors
func google.golang.org/protobuf/internal/filedesc.(*File).Services() ServiceDescriptors
func google.golang.org/protobuf/internal/filedesc.PlaceholderFile.Services() ServiceDescriptors
SourceLocation describes a source location and
corresponds with the google.protobuf.SourceCodeInfo.Location message.
EndLine and EndColumn are the zero-indexed ending location
in the source file for the declaration.
In the descriptor.proto, the end line may be omitted if it is identical
to the start line. Here, it is always populated.
EndLine and EndColumn are the zero-indexed ending location
in the source file for the declaration.
In the descriptor.proto, the end line may be omitted if it is identical
to the start line. Here, it is always populated.
LeadingComments is the leading attached comment for the declaration.
LeadingDetachedComments are the leading detached comments
for the declaration. The contents of this slice must not be mutated.
Next is an index into SourceLocations for the next source location that
has the same Path. It is zero if there is no next location.
Path is the path to the declaration from the root file descriptor.
The contents of this slice must not be mutated.
StartLine and StartColumn are the zero-indexed starting location
in the source file for the declaration.
StartLine and StartColumn are the zero-indexed starting location
in the source file for the declaration.
TrailingComments is the trailing attached comment for the declaration.
func SourceLocations.ByDescriptor(desc Descriptor) SourceLocation
func SourceLocations.ByPath(path SourcePath) SourceLocation
func SourceLocations.Get(int) SourceLocation
func google.golang.org/protobuf/internal/filedesc.(*SourceLocations).ByDescriptor(desc Descriptor) SourceLocation
func google.golang.org/protobuf/internal/filedesc.(*SourceLocations).ByPath(path SourcePath) SourceLocation
func google.golang.org/protobuf/internal/filedesc.(*SourceLocations).Get(i int) SourceLocation
func google.golang.org/protobuf/internal/filedesc.(*SourceLocations).byKey(k filedesc.pathKey) SourceLocation
SourceLocations is a list of source locations.
ByDescriptor returns the SourceLocation for the given descriptor,
returning the first location if multiple exist for the same path.
If no location exists for this descriptor, it returns the zero value.
ByPath returns the SourceLocation for the given path,
returning the first location if multiple exist for the same path.
If multiple locations exist for the same path,
then SourceLocation.Next index can be used to identify the
index of the next SourceLocation.
If no location exists for this path, it returns the zero value.
Get returns the ith SourceLocation. It panics if out of bounds.
Len reports the number of source locations in the proto file.
( T) ProtoInternal(pragma.DoNotImplement)
*google.golang.org/protobuf/internal/filedesc.SourceLocations
T : google.golang.org/protobuf/internal/pragma.DoNotImplement
T : doNotImplement
T : google.golang.org/protobuf/internal/descfmt.list
func FileDescriptor.SourceLocations() SourceLocations
func google.golang.org/protobuf/internal/filedesc.(*File).SourceLocations() SourceLocations
func google.golang.org/protobuf/internal/filedesc.PlaceholderFile.SourceLocations() SourceLocations
The following types are used by the fast-path Message.ProtoMethods method.
To avoid polluting the public protoreflect API with types used only by
low-level implementations, the canonical definitions of these types are
in the runtime/protoiface package. The definitions here and in protoiface
must be kept in sync.
MessageMessageNoUnkeyedLiteralspragma.NoUnkeyedLiterals
The following types are used by the fast-path Message.ProtoMethods method.
To avoid polluting the public protoreflect API with types used only by
low-level implementations, the canonical definitions of these types are
in the runtime/protoiface package. The definitions here and in protoiface
must be kept in sync.
NoUnkeyedLiteralspragma.NoUnkeyedLiterals
The following types are used by the fast-path Message.ProtoMethods method.
To avoid polluting the public protoreflect API with types used only by
low-level implementations, the canonical definitions of these types are
in the runtime/protoiface package. The definitions here and in protoiface
must be kept in sync.
Buf[]byteFlagsuint8MessageMessageNoUnkeyedLiteralspragma.NoUnkeyedLiterals
The following types are used by the fast-path Message.ProtoMethods method.
To avoid polluting the public protoreflect API with types used only by
low-level implementations, the canonical definitions of these types are
in the runtime/protoiface package. The definitions here and in protoiface
must be kept in sync.
Buf[]byteNoUnkeyedLiteralspragma.NoUnkeyedLiterals
The following types are used by the fast-path Message.ProtoMethods method.
To avoid polluting the public protoreflect API with types used only by
low-level implementations, the canonical definitions of these types are
in the runtime/protoiface package. The definitions here and in protoiface
must be kept in sync.
DestinationMessageNoUnkeyedLiteralspragma.NoUnkeyedLiteralsSourceMessage
The following types are used by the fast-path Message.ProtoMethods method.
To avoid polluting the public protoreflect API with types used only by
low-level implementations, the canonical definitions of these types are
in the runtime/protoiface package. The definitions here and in protoiface
must be kept in sync.
Flagsuint8NoUnkeyedLiteralspragma.NoUnkeyedLiterals
The following types are used by the fast-path Message.ProtoMethods method.
To avoid polluting the public protoreflect API with types used only by
low-level implementations, the canonical definitions of these types are
in the runtime/protoiface package. The definitions here and in protoiface
must be kept in sync.
Flagsuint8MessageMessageNoUnkeyedLiteralspragma.NoUnkeyedLiterals
The following types are used by the fast-path Message.ProtoMethods method.
To avoid polluting the public protoreflect API with types used only by
low-level implementations, the canonical definitions of these types are
in the runtime/protoiface package. The definitions here and in protoiface
must be kept in sync.
NoUnkeyedLiteralspragma.NoUnkeyedLiteralsSizeint
The following types are used by the fast-path Message.ProtoMethods method.
To avoid polluting the public protoreflect API with types used only by
low-level implementations, the canonical definitions of these types are
in the runtime/protoiface package. The definitions here and in protoiface
must be kept in sync.
The following types are used by the fast-path Message.ProtoMethods method.
To avoid polluting the public protoreflect API with types used only by
low-level implementations, the canonical definitions of these types are
in the runtime/protoiface package. The definitions here and in protoiface
must be kept in sync.
Flagsuint8NoUnkeyedLiteralspragma.NoUnkeyedLiterals
value is a union where only one type can be represented at a time.
The struct is 24B large on 64-bit systems and requires the minimum storage
necessary to represent each possible type.
The Go GC needs to be able to scan variables containing pointers.
As such, pointers and non-pointers cannot be intermixed.
// 0B
num stores a Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, or
Enum value as a raw uint64.
It is also used to store the length of a String or Bytes value;
the capacity is ignored.
// 8B
ptr stores the data pointer for a String, Bytes, or interface value.
// 8B
typ stores the type of the value as a pointer to the Go type.
// 8B
Package-Level Functions (total 21, in which 14 are exported)
ValueOf returns a Value initialized with the concrete value stored in v.
This panics if the type does not match one of the allowed types in the
Value union.
Constants as defined by the google.protobuf.Cardinality enumeration.
Constants as defined by the google.protobuf.Cardinality enumeration.
Constants as defined by the google.protobuf.Field.Kind enumeration.
Constants as defined by the google.protobuf.Field.Kind enumeration.
Constants as defined by the google.protobuf.Field.Kind enumeration.
Constants as defined by the google.protobuf.Field.Kind enumeration.
Constants as defined by the google.protobuf.Field.Kind enumeration.
Constants as defined by the google.protobuf.Field.Kind enumeration.
Constants as defined by the google.protobuf.Field.Kind enumeration.
The pages are generated with Goldsv0.3.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.