type extField … type Types … // NewTypes creates a new Types registry with the provided files. // The Files registry is retained, and changes to Files will be reflected in Types. // It is not safe to concurrently change the Files while calling Types methods. func NewTypes(f *protoregistry.Files) *Types { … } // FindEnumByName looks up an enum by its full name; // e.g., "google.protobuf.Field.Kind". // // This returns (nil, [protoregistry.NotFound]) if not found. func (t *Types) FindEnumByName(name protoreflect.FullName) (protoreflect.EnumType, error) { … } // FindExtensionByName looks up an extension field by the field's full name. // Note that this is the full name of the field as determined by // where the extension is declared and is unrelated to the full name of the // message being extended. // // This returns (nil, [protoregistry.NotFound]) if not found. func (t *Types) FindExtensionByName(name protoreflect.FullName) (protoreflect.ExtensionType, error) { … } // FindExtensionByNumber looks up an extension field by the field number // within some parent message, identified by full name. // // This returns (nil, [protoregistry.NotFound]) if not found. func (t *Types) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { … } // FindMessageByName looks up a message by its full name; // e.g. "google.protobuf.Any". // // This returns (nil, [protoregistry.NotFound]) if not found. func (t *Types) FindMessageByName(name protoreflect.FullName) (protoreflect.MessageType, error) { … } // FindMessageByURL looks up a message by a URL identifier. // See documentation on google.protobuf.Any.type_url for the URL format. // // This returns (nil, [protoregistry.NotFound]) if not found. func (t *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) { … } func (t *Types) updateExtensions() { … } func (t *Types) registerExtensionsInMessages(mds protoreflect.MessageDescriptors) { … } func (t *Types) registerExtensions(xds protoreflect.ExtensionDescriptors) { … } func descName(d protoreflect.Descriptor) string { … }