descriptor
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package descriptor provides functions for obtaining the protocol bufferdescriptors of generated Go types.
Deprecated: See the "google.golang.org/protobuf/reflect/protoreflect" packagefor how to obtain an EnumDescriptor or MessageDescriptor in order toprogramatically interact with the protobuf type system.
Index¶
- func EnumDescriptorProto(e proto.GeneratedEnum) (*descriptorpb.FileDescriptorProto, *descriptorpb.EnumDescriptorProto)
- func EnumRawDescriptor(e proto.GeneratedEnum) ([]byte, []int)
- func ForMessage(m Message) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto)deprecated
- func MessageDescriptorProto(m proto.GeneratedMessage) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto)
- func MessageRawDescriptor(m proto.GeneratedMessage) ([]byte, []int)
- type Messagedeprecated
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcEnumDescriptorProto¶added inv1.4.0
func EnumDescriptorProto(eproto.GeneratedEnum) (*descriptorpb.FileDescriptorProto, *descriptorpb.EnumDescriptorProto)
EnumDescriptorProto returns the file descriptor proto representingthe enum and the enum descriptor proto for the enum itself.The returned proto messages must not be mutated.
funcEnumRawDescriptor¶added inv1.4.0
func EnumRawDescriptor(eproto.GeneratedEnum) ([]byte, []int)
EnumRawDescriptor returns the GZIP'd raw file descriptor representingthe enum and the index path to reach the enum declaration.The returned slices must not be mutated.
funcForMessagedeprecated
func ForMessage(mMessage) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto)
ForMessage returns the file descriptor proto containingthe message and the message descriptor proto for the message itself.The returned proto messages must not be mutated.
Deprecated: Not all concrete message types satisfy the Message interface.Use MessageDescriptorProto instead. If possible, the calling code shouldbe rewritten to use protobuf reflection instead.See package "google.golang.org/protobuf/reflect/protoreflect" for details.
funcMessageDescriptorProto¶added inv1.4.0
func MessageDescriptorProto(mproto.GeneratedMessage) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto)
MessageDescriptorProto returns the file descriptor proto representingthe message and the message descriptor proto for the message itself.The returned proto messages must not be mutated.
funcMessageRawDescriptor¶added inv1.4.0
func MessageRawDescriptor(mproto.GeneratedMessage) ([]byte, []int)
MessageRawDescriptor returns the GZIP'd raw file descriptor representingthe message and the index path to reach the message declaration.The returned slices must not be mutated.
Types¶
typeMessagedeprecated
Message is proto.Message with a method to return its descriptor.
Deprecated: The Descriptor method may not be generated by futureversions of protoc-gen-go, meaning that this interface may notbe implemented by many concrete message types.