type Db … type extensionMap … var DefaultDb … // Merge will copy the source proto message into the destination, or error if the merge cannot be completed. // // Unlike the proto.Merge, this method will fallback to proto.Marshal/Unmarshal of the two proto messages do not // share the same instance of their type descriptor. func Merge(dstPB, srcPB proto.Message) error { … } // NewDb creates a new `pb.Db` with an empty type name to file description map. func NewDb() *Db { … } // Copy creates a copy of the current database with its own internal descriptor mapping. func (pbdb *Db) Copy() *Db { … } // FileDescriptions returns the set of file descriptions associated with this db. func (pbdb *Db) FileDescriptions() []*FileDescription { … } // RegisterDescriptor produces a `FileDescription` from a `FileDescriptor` and registers the // message and enum types into the `pb.Db`. func (pbdb *Db) RegisterDescriptor(fileDesc protoreflect.FileDescriptor) (*FileDescription, error) { … } // RegisterMessage produces a `FileDescription` from a `message` and registers the message and all // other definitions within the message file into the `pb.Db`. func (pbdb *Db) RegisterMessage(message proto.Message) (*FileDescription, error) { … } // DescribeEnum takes a qualified enum name and returns an `EnumDescription` if it exists in the // `pb.Db`. func (pbdb *Db) DescribeEnum(enumName string) (*EnumValueDescription, bool) { … } // DescribeType returns a `TypeDescription` for the `typeName` if it exists in the `pb.Db`. func (pbdb *Db) DescribeType(typeName string) (*TypeDescription, bool) { … } // CollectFileDescriptorSet builds a file descriptor set associated with the file where the input // message is declared. func CollectFileDescriptorSet(message proto.Message) map[string]protoreflect.FileDescriptor { … } func init() { … }