package descriptor
import "github.com/golang/protobuf/descriptor"
Package descriptor provides functions for obtaining the protocol buffer descriptors of generated Go types.
Deprecated: See the "google.golang.org/protobuf/reflect/protoreflect" package for how to obtain an EnumDescriptor or MessageDescriptor in order to programatically 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)
- func MessageDescriptorProto(m proto.GeneratedMessage) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto)
- func MessageRawDescriptor(m proto.GeneratedMessage) ([]byte, []int)
- type Message
Functions ¶
func EnumDescriptorProto ¶
func EnumDescriptorProto(e proto.GeneratedEnum) (*descriptorpb.FileDescriptorProto, *descriptorpb.EnumDescriptorProto)
EnumDescriptorProto returns the file descriptor proto representing the enum and the enum descriptor proto for the enum itself. The returned proto messages must not be mutated.
func EnumRawDescriptor ¶
func EnumRawDescriptor(e proto.GeneratedEnum) ([]byte, []int)
EnumRawDescriptor returns the GZIP'd raw file descriptor representing the enum and the index path to reach the enum declaration. The returned slices must not be mutated.
func ForMessage ¶
func ForMessage(m Message) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto)
ForMessage returns the file descriptor proto containing the 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 should be rewritten to use protobuf reflection instead. See package "google.golang.org/protobuf/reflect/protoreflect" for details.
func MessageDescriptorProto ¶
func MessageDescriptorProto(m proto.GeneratedMessage) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto)
MessageDescriptorProto returns the file descriptor proto representing the message and the message descriptor proto for the message itself. The returned proto messages must not be mutated.
func MessageRawDescriptor ¶
func MessageRawDescriptor(m proto.GeneratedMessage) ([]byte, []int)
MessageRawDescriptor returns the GZIP'd raw file descriptor representing the message and the index path to reach the message declaration. The returned slices must not be mutated.
Types ¶
type Message ¶
Message is proto.Message with a method to return its descriptor.
Deprecated: The Descriptor method may not be generated by future versions of protoc-gen-go, meaning that this interface may not be implemented by many concrete message types.
Source Files ¶
- Version
- v1.5.4 (latest)
- Published
- Mar 6, 2024
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 5 days ago –
Tools for package owners.