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.
(m proto.GeneratedMessage)
| 109 | // the message and the index path to reach the message declaration. |
| 110 | // The returned slices must not be mutated. |
| 111 | func MessageRawDescriptor(m proto.GeneratedMessage) ([]byte, []int) { |
| 112 | if mv, ok := m.(interface{ Descriptor() ([]byte, []int) }); ok { |
| 113 | return mv.Descriptor() |
| 114 | } |
| 115 | md := protoimpl.X.MessageTypeOf(m) |
| 116 | return deriveRawDescriptor(md.Descriptor()) |
| 117 | } |
| 118 | |
| 119 | var fileDescCache sync.Map // map[*byte]*descriptorpb.FileDescriptorProto |
| 120 |