mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-06 00:55:51 +00:00
6e67a1d614
The first commit of protoregistry only added a registry for files. However, a separate type of registry is needed to provide a mapping between protobuf names and actual Go types representing those names. Additional high-level API: var GlobalTypes = new(Types) type Type interface{ ... } type Types struct{ ... } func NewTypes(...Type) *Types func (*Types) Register(...Type) error func (*Types) FindEnumByName(pref.FullName) (pref.EnumType, error) func (*Types) FindMessageByName(pref.FullName) (pref.MessageType, error) func (*Types) FindMessageByURL(string) (pref.MessageType, error) func (*Types) FindExtensionByName(pref.FullName) (pref.ExtensionType, error) func (*Types) FindExtensionByNumber(pref.FullName, pref.FieldNumber) (pref.ExtensionType, error) func (*Types) RangeEnums(func(pref.EnumType) bool) func (*Types) RangeMessages(func(pref.MessageType) bool) func (*Types) RangeExtensions(func(pref.ExtensionType) bool) func (*Types) RangeExtensionsByMessage(pref.FullName, func(pref.ExtensionType) bool) Change-Id: I0d07705801684a1eb5853bcd05fcce12598a0047 Reviewed-on: https://go-review.googlesource.com/c/131345 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> |
||
---|---|---|
.. | ||
protodesc | ||
protoreflect | ||
protoregistry | ||
prototype |