You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The proto.MessageType and proto.GetProperties functions can, together, be used to introspect the fields available to a protobuf message type identified by name. This request is for corresponding functionality that operates at the level of protobuf packages.
The API doesn't need to be very complex, just enough to figure out which messages are available:
type Package struct {
Name string // "k8s.io.some.package"
}
func (*Package) MessageTypes() []reflect.Type
// []string{"k8s.io.some.package.SomeMessage", "k8s.io.some.package.OtherMessage"}
func (*Package) MessageNames() []string
Use case: I want to add type safety to an existing protobuf-compatible config system. The user-visible behavior and error messages will be much more pleasant if the code can introspect the set of messages available to a named Protobuf package.
The text was updated successfully, but these errors were encountered:
Hi, thanks for the issue. I'm going to close this as a duplicate of #268, which is the super-bug, tracking registration improvements. What you are describing is a feature I would like to see be possible in the overhaul of registration.
The
proto.MessageType
andproto.GetProperties
functions can, together, be used to introspect the fields available to a protobuf message type identified by name. This request is for corresponding functionality that operates at the level of protobuf packages.The API doesn't need to be very complex, just enough to figure out which messages are available:
Use case: I want to add type safety to an existing protobuf-compatible config system. The user-visible behavior and error messages will be much more pleasant if the code can introspect the set of messages available to a named Protobuf package.
The text was updated successfully, but these errors were encountered: